var first string
for _, src := range srcs {
if src.source == "myhostname" {
- if isLocalhost(hostname) || isGateway(hostname) {
+ if isLocalhost(hostname) || isGateway(hostname) || isOutbound(hostname) {
return fallbackOrder
}
hn, err := getHostname()
// isGateway reports whether h should be considered a "gateway"
// name for the myhostname NSS module.
func isGateway(h string) bool {
- return stringsEqualFold(h, "gateway")
+ return stringsEqualFold(h, "_gateway")
+}
+
+// isOutbound reports whether h should be considered a "outbound"
+// name for the myhostname NSS module.
+func isOutbound(h string) bool {
+ return stringsEqualFold(h, "_outbound")
}
{"myHostname", "myhostname", hostLookupCgo},
{"myhostname.dot", "myhostname.dot", hostLookupCgo},
{"myHostname.dot", "myhostname.dot", hostLookupCgo},
- {"gateway", "myhostname", hostLookupCgo},
- {"Gateway", "myhostname", hostLookupCgo},
+ {"_gateway", "myhostname", hostLookupCgo},
+ {"_Gateway", "myhostname", hostLookupCgo},
+ {"_outbound", "myhostname", hostLookupCgo},
+ {"_Outbound", "myhostname", hostLookupCgo},
{"localhost", "myhostname", hostLookupCgo},
{"Localhost", "myhostname", hostLookupCgo},
{"anything.localhost", "myhostname", hostLookupCgo},