You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot bind to Fully qualified domain name (FQDN) #4477
Hello, I am trying to upgrade my hapi to v21. I created a simple project just to make sure everything works.
It seems that hapi is not binding when i use the FQDN. It only binds when using 0.0.0.0. I verified this using netstat -a. This is running NodeJS v18 and HapiJS v21 on Windows Server 2019. It is showing in netstat when the FQDN is used but it looks like this
FYI, the DNS resolution behaviour has been changed in node to prefer IPv6. Unlike for client connections, there doesn't seem to be any way to tell the listener it to prefer IPv4 when resolving it. You will likely have to use the dns module to pre-resolve it yourself.
Activity
kanongil commentedon Jan 25, 2024
Hapi doesn't do anything with the FQDN, except pass it to the node http server
listen()method, documented here.FYI, the DNS resolution behaviour has been changed in node to prefer IPv6. Unlike for client connections, there doesn't seem to be any way to tell the listener it to prefer IPv4 when resolving it. You will likely have to use the
dnsmodule to pre-resolve it yourself.croeber8 commentedon Jan 25, 2024
Yeah, resolving the host using dns.resolve works. Still weird I have to do that though.