summaryrefslogtreecommitdiffhomepage
path: root/netboot/netconf.go
diff options
context:
space:
mode:
Diffstat (limited to 'netboot/netconf.go')
-rw-r--r--netboot/netconf.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/netboot/netconf.go b/netboot/netconf.go
index bf0274e..3cc5232 100644
--- a/netboot/netconf.go
+++ b/netboot/netconf.go
@@ -208,7 +208,9 @@ func ConfigureInterface(ifname string, netconf *NetConf) error {
for _, ns := range netconf.DNSServers {
resolvconf += fmt.Sprintf("nameserver %s\n", ns)
}
- resolvconf += fmt.Sprintf("search %s\n", strings.Join(netconf.DNSSearchList, " "))
+ if len(netconf.DNSSearchList) > 0 {
+ resolvconf += fmt.Sprintf("search %s\n", strings.Join(netconf.DNSSearchList, " "))
+ }
if err = ioutil.WriteFile("/etc/resolv.conf", []byte(resolvconf), 0644); err != nil {
return fmt.Errorf("could not write resolv.conf file %v", err)
}