When you try to resolve a domain within localhost (e.g. example.localhost) netty currently queries checks the hosts file and queries the DNS server if it isn't defined there. If the DNS server does not resolve the record then netty throws an unknown host exception. This was tested on MacOS with Netty 4.2.12.Final.
The correct behaviour is defined in RFC 6761 Section 6.3:
Name resolution APIs and libraries SHOULD recognize localhost
names as special and SHOULD always return the IP loopback address
for address queries and negative responses for all other query
types. Name resolution APIs SHOULD NOT send queries for
localhost names to their configured caching DNS server(s).
There already is an exception for resolving localhost specifically on Windows because it isn't in the hosts file (see #5410). Expanding that to apply to all subdomains of localhost on all systems would solve this issue.
When you try to resolve a domain within localhost (e.g.
example.localhost) netty currently queries checks the hosts file and queries the DNS server if it isn't defined there. If the DNS server does not resolve the record then netty throws an unknown host exception. This was tested on MacOS with Netty 4.2.12.Final.The correct behaviour is defined in RFC 6761 Section 6.3:
There already is an exception for resolving
localhostspecifically on Windows because it isn't in the hosts file (see #5410). Expanding that to apply to all subdomains oflocalhoston all systems would solve this issue.