question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DnsNameResolver uses public dns servers in java 9

See original GitHub issue

I realise this is known, but it seems broken enough to deserve a tracking issue.

Expected behavior

Should use system dns servers

Actual behavior

Logs a warning “Default DNS servers: [/8.8.8.8:53, /8.8.4.4:53] (Google Public DNS as a fallback)” Then uses the google servers.

n.b. It logs the warning even if you manually set the nameServerAddresses

    .nameServerAddresses(
        DnsServerAddresses.sequential(new InetSocketAddress("x.x.x.x", 53),
            new InetSocketAddress("x.x.x.x", 53)))

Steps to reproduce

Minimal yet complete reproducer code (or URL to code)

Netty version

JVM version (e.g. java -version)

java version “9-ea” Java™ SE Runtime Environment (build 9-ea+149) Java HotSpot™ 64-Bit Server VM (build 9-ea+149, mixed mode)

OS version (e.g. uname -a)

Workaround

set on command line

–add-opens=java.base/sun.net.dns=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
normanmaurercommented, Feb 11, 2017

@yschimke thanks for reporting… working on a fix

0reactions
normanmaurercommented, Apr 19, 2017
Read more comments on GitHub >

github_iconTop Results From Across the Web

DnsNameResolver xref - Netty
90 */ 91 public class DnsNameResolver extends InetNameResolver { 92 93 ... throws Exception { 190 // Only try if not using Java9...
Read more >
How to configure the DNS server java should use in jdk 9, 10 ...
Previously we could make java use our DNS server (here it is just using local host) by using: "-Dsun.net.spi.nameservice.nameservers=127.0.0.1", ...
Read more >
io.netty.resolver.dns.DnsNameResolver Maven / Gradle / Ivy
io.netty.resolver.dns.DnsNameResolver maven / gradle build tool code. The class is part of the package ➦ Group: io.netty ➦ Artifact: netty-all ➦ Version: ...
Read more >
"Fossies" - the Fresh Open Source Software Archive
Member "netty-netty-4.1.85.Final/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java" (9 Nov 2022, 68179 Bytes) of package /linux/misc/netty- ...
Read more >
DnsNameResolver.authoritativeDnsServerCache - Java
authoritativeDnsServerCache (Showing top 9 results out of 315) ... @param nameservers The addresses of the DNS servers which are used in the event...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found