mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-20 19:09:07 +01:00
Add nameserver as resolver aswell
This commit is contained in:
parent
01e781e546
commit
b3732e7fb9
@ -83,6 +83,7 @@ func getDNSConfig() *tailcfg.DNSConfig {
|
|||||||
nameserversStr := viper.GetStringSlice("dns_config.nameservers")
|
nameserversStr := viper.GetStringSlice("dns_config.nameservers")
|
||||||
|
|
||||||
nameservers := make([]netaddr.IP, len(nameserversStr))
|
nameservers := make([]netaddr.IP, len(nameserversStr))
|
||||||
|
resolvers := make([]tailcfg.DNSResolver, len(nameserversStr))
|
||||||
|
|
||||||
for index, nameserverStr := range nameserversStr {
|
for index, nameserverStr := range nameserversStr {
|
||||||
nameserver, err := netaddr.ParseIP(nameserverStr)
|
nameserver, err := netaddr.ParseIP(nameserverStr)
|
||||||
@ -94,9 +95,13 @@ func getDNSConfig() *tailcfg.DNSConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
nameservers[index] = nameserver
|
nameservers[index] = nameserver
|
||||||
|
resolvers[index] = tailcfg.DNSResolver{
|
||||||
|
Addr: nameserver.String() + ":53",
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dnsConfig.Nameservers = nameservers
|
dnsConfig.Nameservers = nameservers
|
||||||
|
dnsConfig.Resolvers = resolvers
|
||||||
}
|
}
|
||||||
if viper.IsSet("dns_config.domains") {
|
if viper.IsSet("dns_config.domains") {
|
||||||
dnsConfig.Domains = viper.GetStringSlice("dns_config.domains")
|
dnsConfig.Domains = viper.GetStringSlice("dns_config.domains")
|
||||||
|
Loading…
Reference in New Issue
Block a user