// illumos defaults to "nis [NOTFOUND=return] files"
return fallbackOrder
}
- if c.goos == "linux" {
- // glibc says the default is "dns [!UNAVAIL=return] files"
- // https://www.gnu.org/software/libc/manual/html_node/Notes-on-NSS-Configuration-File.html.
- return hostLookupDNSFiles
- }
return hostLookupFilesDNS
}
if nss.err != nil {
},
hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupDNSFiles}},
},
- // glibc lacking an nsswitch.conf, per
- // https://www.gnu.org/software/libc/manual/html_node/Notes-on-NSS-Configuration-File.html
{
name: "linux_no_nsswitch.conf",
c: &conf{
nss: &nssConf{err: fs.ErrNotExist},
resolv: defaultResolvConf,
},
- hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupDNSFiles}},
+ hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupFilesDNS}},
+ },
+ {
+ name: "linux_empty_nsswitch.conf",
+ c: &conf{
+ goos: "linux",
+ nss: nssStr(""),
+ resolv: defaultResolvConf,
+ },
+ hostTests: []nssHostTest{{"google.com", "myhostname", hostLookupFilesDNS}},
},
{
name: "files_mdns_dns",