mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-20 19:09:07 +01:00
add the possibility for custom DNS records
related to https://github.com/juanfont/headscale/issues/762 Co-Authored-By: Jamie Greeff <jamie@greeff.me> Signed-off-by: Christian Heusel <christian@heusel.eu>
This commit is contained in:
parent
7bb6f1a7eb
commit
ab6565723e
14
config.go
14
config.go
@ -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")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user