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
Resolve all localhost addresses without querying DNS servers (#16749)
Motivation:
According to RFC 6761, all domains within .localhost. should be resolved
to the loopback address without querying DNS servers. This is useful
e.g. when you have multiple web servers behind a local reverse proxy and
you want to route the requests based on the hostname. Previously, netty
would only resolve hostnames specified in the hosts file (or localhost
and the machine hostname on windows) without querying DNS servers.
Modifications:
- localhost and all domains within .localhost. are now directly resolved
to the loopback address
- Replaced isLocalWindowsHost with isLocalHostAddress
- Replaced LOCALHOST_ADDRESS constant with getLocalHostAddress method to
correctly return the correct loopback address based on
resolvedAddressTypes
- Added test that covers all combinations of
DnsNameResolverChannelStrategy, ResolvedAddressTypes and various
localhost hostnames
Result:
Localhost hostnames are now resolved directly to the loopback address
without querying a DNS server. Overriding them in the hosts file is
still possible.
Fixes#16744
---------
Co-authored-by: Norman Maurer <[email protected]>
0 commit comments