Skip to content

Auto-port 4.1: Add system property to disable RFC 6761 localhost resolution - #17230

Merged
normanmaurer merged 3 commits into
4.1from
auto-port-pr-17100-to-4.1
Aug 7, 2026
Merged

normanmaurer merged 3 commits into
4.1from
auto-port-pr-17100-to-4.1

Conversation

@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port of #17100 to 4.1
Cherry-picked commit: 14c628f


Motivation:
Commit a6aeb6d (#16749) resolves localhost and *.localhost to loopback without querying DNS per RFC 6761. Some deployment environments use *.localhost hostnames that should resolve via DNS to non-loopback addresses.

Modifications:

Result:
Applications can opt out of automatic loopback resolution for .localhost hostnames by setting the system property to false.

Fixes
This fixes the scenario where *.localhost is used for non-loopback addresses, e.g. as an entrypoint into a service mesh.

Motivation:
Commit a6aeb6d (#16749) resolves localhost and *.localhost to loopback
without querying DNS per RFC 6761. Some deployment environments use
*.localhost hostnames that should resolve via DNS to non-loopback
addresses.

Modifications:
- Add -Dio.netty.resolver.dns.resolveLocalhostWithoutDns (default true)
- When false, restore pre-#16749 behavior where only Windows localhost
and the Windows machine hostname are short-circuited to loopback
- Add tests verifying *.localhost falls through to DNS when disabled

Result:
Applications can opt out of automatic loopback resolution for .localhost
hostnames by setting the system property to false.

Fixes
This fixes the scenario where *.localhost is used for non-loopback
addresses, e.g. as an entrypoint into a service mesh.

---------

Co-authored-by: Chris Vest <[email protected]>
(cherry picked from commit 14c628f)
Comment thread resolver-dns/pom.xml Resolved
@normanmaurer
normanmaurer merged commit 0c57ae7 into 4.1 Aug 7, 2026
29 of 33 checks passed
@normanmaurer
normanmaurer deleted the auto-port-pr-17100-to-4.1 branch August 7, 2026 12:01
@normanmaurer normanmaurer added this to the 4.1.138.Final milestone Aug 7, 2026
lltopk pushed a commit to lltopk/netty that referenced this pull request Oct 24, 2026
…lution (netty#17230)

Auto-port of netty#17100 to 4.1
Cherry-picked commit: 14c628f

---
Motivation:
Commit a6aeb6d (netty#16749) resolves localhost and *.localhost to loopback
without querying DNS per RFC 6761. Some deployment environments use
*.localhost hostnames that should resolve via DNS to non-loopback
addresses.

Modifications:
- Add -Dio.netty.resolver.dns.resolveLocalhostWithoutDns (default true)
- When false, restore pre-netty#16749 behavior where only Windows localhost
and the Windows machine hostname are short-circuited to loopback
- Add tests verifying *.localhost falls through to DNS when disabled

Result:
Applications can opt out of automatic loopback resolution for .localhost
hostnames by setting the system property to false.

Fixes 
This fixes the scenario where *.localhost is used for non-loopback
addresses, e.g. as an entrypoint into a service mesh.

---------

Co-authored-by: John Reilly <[email protected]>
Co-authored-by: Chris Vest <[email protected]>
Co-authored-by: Norman Maurer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants