FQDN()
broken on darwin
#224
Labels
bug
Something isn't working
Team:Elastic-Agent
Label for the Agent team
Team:Elastic-Agent-Control-Plane
Label for the Agent Control Plane team
Team:Elastic-Agent-Data-Plane
Label for the Agent Data Plane team
Right now, on my machine running Sonoma 14.4.1 (23E224),
FQDN()
fails:On this host,
hostname
returnsAlexs-MacBook-Pro-2.local
. Interestingly, the Endpoint code seems to be failing in a similar way; that hostname value will return an error when put togetaddrinfo()
. However, golang usesres_nsearch()
instead ofgetaddrinfo()
so there's something else going on.Confirmed the same behavior on Sonoma 14.5.
Interestingly, on 10.15, it doesn't return an error, but just returns
localhost
, which is also incorrect, as it's different from the actual domain name set viahostname
. This is due to tonet.DefaultResolver.LookupAddr
just returninglocalhost
if you send it something like::1
However, on 10.15, we still default to the cgo resolver, but this succeeds with
localhost
. but if you force the go-native resolver instead ofgetaddrinfo()
viaGODEBUG=netdns=go
, 10.15 will now fail with the exact same error asgetaddrinfo()
on 14.4.EDIT: I don't think this is fully related to release versions, but some mDNS setting I can't figure out. As this stackoverflow issue notes: https://apple.stackexchange.com/questions/253817/cannot-ping-my-local-machine , enabling sharing in MacOS makes it magically work. Not sure what the system is doing under the hood to the DNS settings when you change sharing settings.
The text was updated successfully, but these errors were encountered: