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
2 people authored and juanfont committed Dec 21, 2022
1 parent b54c0e3 commit 582bb8a
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 @@ -448,6 +448,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 582bb8a

Please sign in to comment.