mirror of
https://github.com/tailscale/tailscale.git
synced 2026-05-05 20:26:47 +02:00
net/dns/resolvd: properly handle not having "search" entries
This prevents adding an empty "search" line when no search domains are set. Signed-off-by: Aaron Bieber <aaron@bolddaemon.com> (cherry picked from commit e5cd765e0064199f12a4ef9fa9e94493e068c496)
This commit is contained in:
parent
6a949d39e0
commit
df5d9aa4ef
@ -60,7 +60,9 @@ func (m *resolvdManager) SetDNS(config OSConfig) error {
|
||||
newSearch = append(newSearch, s.WithoutTrailingDot())
|
||||
}
|
||||
|
||||
newResolvConf = append(newResolvConf, []byte(strings.Join(newSearch, " "))...)
|
||||
if len(newSearch) > 1 {
|
||||
newResolvConf = append(newResolvConf, []byte(strings.Join(newSearch, " "))...)
|
||||
}
|
||||
|
||||
err = m.fs.WriteFile(resolvConf, newResolvConf, 0644)
|
||||
if err != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user