From b3732e7fb9d9dd28da35ac9c9b62a99e483da860 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Wed, 25 Aug 2021 07:04:48 +0100 Subject: [PATCH] Add nameserver as resolver aswell --- cmd/headscale/cli/utils.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/headscale/cli/utils.go b/cmd/headscale/cli/utils.go index 7ba78648..b5c7c219 100644 --- a/cmd/headscale/cli/utils.go +++ b/cmd/headscale/cli/utils.go @@ -83,6 +83,7 @@ func getDNSConfig() *tailcfg.DNSConfig { nameserversStr := viper.GetStringSlice("dns_config.nameservers") nameservers := make([]netaddr.IP, len(nameserversStr)) + resolvers := make([]tailcfg.DNSResolver, len(nameserversStr)) for index, nameserverStr := range nameserversStr { nameserver, err := netaddr.ParseIP(nameserverStr) @@ -94,9 +95,13 @@ func getDNSConfig() *tailcfg.DNSConfig { } nameservers[index] = nameserver + resolvers[index] = tailcfg.DNSResolver{ + Addr: nameserver.String() + ":53", + } } dnsConfig.Nameservers = nameservers + dnsConfig.Resolvers = resolvers } if viper.IsSet("dns_config.domains") { dnsConfig.Domains = viper.GetStringSlice("dns_config.domains")