net/dns: make FQDN dot style consistent in more places.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson 2021-04-08 22:02:50 -07:00
parent 6d01d3bece
commit b74a8994ca
2 changed files with 4 additions and 3 deletions

View File

@ -6,6 +6,7 @@
import ( import (
"sort" "sort"
"strings"
"inet.af/netaddr" "inet.af/netaddr"
) )
@ -91,14 +92,14 @@ func (c Config) matchDomains() []string {
if seen[suffix] { if seen[suffix] {
continue continue
} }
ret = append(ret, suffix) ret = append(ret, strings.TrimSuffix(suffix, "."))
seen[suffix] = true seen[suffix] = true
} }
for suffix := range c.Routes { for suffix := range c.Routes {
if seen[suffix] { if seen[suffix] {
continue continue
} }
ret = append(ret, suffix) ret = append(ret, strings.TrimSuffix(suffix, "."))
seen[suffix] = true seen[suffix] = true
} }
sort.Strings(ret) sort.Strings(ret)

View File

@ -154,7 +154,7 @@ func (m *Manager) compileConfig(cfg Config) (resolver.Config, OSConfig, error) {
LocalDomains: addFQDNDots(cfg.AuthoritativeSuffixes), LocalDomains: addFQDNDots(cfg.AuthoritativeSuffixes),
} }
for suffix, resolvers := range cfg.Routes { for suffix, resolvers := range cfg.Routes {
rcfg.Routes[suffix+"."] = resolvers rcfg.Routes[suffix] = resolvers
} }
ocfg = OSConfig{ ocfg = OSConfig{
Nameservers: []netaddr.IP{tsaddr.TailscaleServiceIP()}, Nameservers: []netaddr.IP{tsaddr.TailscaleServiceIP()},