-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
•The hostname "_gateway" is resolved to all current default routing gateway addresses, ordered by their metric. (...)
•The hostname "_outbound" is resolved to the local IPv4 and IPv6 addresses that are most likely used for communication with other hosts. (...)
But it only checks for the "gateway" hostname which is incorrect, it should check for "_gateway" (as defined in man page), and _outbound.
Lines 249 to 251 in 7e72d38
if isLocalhost(hostname) || isGateway(hostname) { | |
return fallbackOrder | |
} |
Lines 348 to 352 in 7e72d38
// isGateway reports whether h should be considered a "gateway" | |
// name for the myhostname NSS module. | |
func isGateway(h string) bool { | |
return stringsEqualFold(h, "gateway") | |
} |
package main
import (
"fmt"
"net"
)
func main() {
fmt.Println(net.LookupHost("localhost"))
fmt.Println(net.LookupHost("_gateway"))
fmt.Println(net.LookupHost("_outbound"))
}
[mateusz@arch testtt]$ GODEBUG=netdns=2 go run main.go
go package net: confVal.netCgo = false netGo = false
go package net: dynamic selection of DNS resolver
go package net: hostLookupOrder(localhost) = cgo
[::1 127.0.0.1] <nil>
go package net: hostLookupOrder(_gateway) = files,dns
[] lookup _gateway on 81.26.0.10:53: no such host
go package net: hostLookupOrder(_outbound) = files,dns
[] lookup _outbound on 81.26.0.10:53: no such host
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.