Skip to content

Auto-port 5.0: Add system property to disable RFC 6761 localhost resolution - #17231

Merged
normanmaurer merged 1 commit into
5.0from
auto-port-pr-17100-to-5.0
Aug 7, 2026
Merged

normanmaurer merged 1 commit into
5.0from
auto-port-pr-17100-to-5.0

Conversation

@netty-project-bot

Copy link
Copy Markdown
Contributor

Auto-port of #17100 to 5.0
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)
@testlens-app

testlens-app Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

🚨 TestLens detected 1 failed test 🚨

Here is what you can do:

  1. Inspect the test failures carefully.
  2. If you are convinced that some of the tests are flaky, you can mute them below.
  3. Finally, trigger a rerun by checking the rerun checkbox.

Test Summary

Build PR / macos-aarch64-java25-boringssl build > Netty/Transport/Native/KQueue

Test Runs Flakiness
KQueueDatagramUnicastIPv6MappedTest > testSimpleSendWithConnect(TestInfo) ❌ 3% 🟡

🏷️ Commit: 9a2235a
▶️ Tests: 40738 executed
⚪️ Checks: 12/12 completed

Test Failures

KQueueDatagramUnicastIPv6MappedTest > testSimpleSendWithConnect(TestInfo) (Netty/Transport/Native/KQueue in Build PR / macos-aarch64-java25-boringssl build)
org.opentest4j.AssertionFailedError
	at io.netty.testsuite.transport.socket.DatagramUnicastTest.testSimpleSendWithConnect0(DatagramUnicastTest.java:414)
	at io.netty.testsuite.transport.socket.DatagramUnicastTest.testSimpleSendWithConnect(DatagramUnicastTest.java:375)
	at io.netty.testsuite.transport.socket.DatagramUnicastTest.testSimpleSendWithConnect(DatagramUnicastTest.java:211)
	at io.netty.testsuite.transport.socket.DatagramUnicastTest$7.run(DatagramUnicastTest.java:204)
	at io.netty.testsuite.transport.socket.DatagramUnicastTest$7.run(DatagramUnicastTest.java:201)
	at io.netty.testsuite.transport.AbstractComboTestsuiteTest.run(AbstractComboTestsuiteTest.java:52)
	at io.netty.testsuite.transport.socket.DatagramUnicastTest.testSimpleSendWithConnect(DatagramUnicastTest.java:201)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)

Muted Tests

Select tests to mute in this pull request:

  • KQueueDatagramUnicastIPv6MappedTest > testSimpleSendWithConnect(TestInfo)

Reuse successful test results:

  • ♻️ Only rerun the tests that failed or were muted before

Click the checkbox to trigger a rerun:

  • Rerun jobs

Learn more about TestLens at testlens.app.

@normanmaurer normanmaurer added this to the 5.0.0.Final milestone Aug 7, 2026
@normanmaurer
normanmaurer merged commit bc9a8f0 into 5.0 Aug 7, 2026
12 of 13 checks passed
@normanmaurer
normanmaurer deleted the auto-port-pr-17100-to-5.0 branch August 7, 2026 12:01
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