diff --git a/pkg/pillar/cmd/zedrouter/dnsmasq.go b/pkg/pillar/cmd/zedrouter/dnsmasq.go index 03938c5457..8139d8570c 100644 --- a/pkg/pillar/cmd/zedrouter/dnsmasq.go +++ b/pkg/pillar/cmd/zedrouter/dnsmasq.go @@ -222,10 +222,14 @@ func createDnsmasqConfiglet( } } advertizeDns := false - for _, ns := range netstatus.DnsServers { + if len(netstatus.DnsServers) > 0 { advertizeDns = true + var addrList []string + for _, srvIP := range netstatus.DnsServers { + addrList = append(addrList, srvIP.String()) + } file.WriteString(fmt.Sprintf("dhcp-option=option:dns-server,%s\n", - ns.String())) + strings.Join(addrList, ","))) } if netstatus.NtpServer != nil { file.WriteString(fmt.Sprintf("dhcp-option=option:ntp-server,%s\n",