Skip to content

Commit

Permalink
add the possibility for custom DNS records
Browse files Browse the repository at this point in the history
related to #762

Co-Authored-By: Jamie Greeff <[email protected]>
Signed-off-by: Christian Heusel <[email protected]>
  • Loading branch information
christian-heusel and madjam002 committed Dec 2, 2022
1 parent 5a70ea7 commit 8ef6ce5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,20 @@ func GetDNSConfig() (*tailcfg.DNSConfig, string) {
}
}

if viper.IsSet("dns_config.extra_records") {
var extraRecords []tailcfg.DNSRecord

err := viper.UnmarshalKey("dns_config.extra_records", &extraRecords)
if err != nil {
log.Error().
Str("func", "getDNSConfig").
Err(err).
Msgf("Could not parse dns_config.extra_records")
}

dnsConfig.ExtraRecords = extraRecords
}

if viper.IsSet("dns_config.magic_dns") {
dnsConfig.Proxied = viper.GetBool("dns_config.magic_dns")
}
Expand Down

0 comments on commit 8ef6ce5

Please sign in to comment.