IPv6 Nameservers in resolv.conf

Alan Bateman Alan.Bateman at oracle.com
Tue Oct 12 09:06:26 PDT 2010


Guenther Niess wrote:
> Hi,
> Linux systems don't require and moreover don't allow to use IPv6
> literal host names within delimiting brackets for nameservers in
> /etc/resolv.conf. So IPv6 entries have the form:
>   nameserver 2001:0db8:85a3:08d3:1319:8a2e:0370:7344
> Now, when I try to use a nameserver a NumberFormatException is thrown:
> java.lang.NumberFormatException: For input string: "0db8:85a3:08d3:1319:8a2e:0370:7344"
>   at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
>   at java.lang.Integer.parseInt(Integer.java:481)
>   at java.lang.Integer.parseInt(Integer.java:514)
>   at com.sun.jndi.dns.DnsClient.<init>(DnsClient.java:122)
>   at com.sun.jndi.dns.Resolver.<init>(Resolver.java:61)
>   at com.sun.jndi.dns.DnsContext.getResolver(DnsContext.java:570)
>   at com.sun.jndi.dns.DnsContext.c_getAttributes(DnsContext.java:430)
>   at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_getAttributes(ComponentDirContext.java:231)
>   at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(PartialCompositeDirContext.java:139)
>   at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(PartialCompositeDirContext.java:127)
>   at javax.naming.directory.InitialDirContext.getAttributes(InitialDirContext.java:140)
>   at NSLookup.main(NSLookup.java:14)
>
> So I think the JDK should handle IPv6 nameservers and therefore I
> attached a small patch which works fine for me.
>
> Best regards
> Guenther
>
> PS: I submitted a bug report on bugs.sun.com two months ago (Review ID:
> 1854941) with no response. So I'm trying this list, maybe the bug 
> database isn't used any more.
>   
I don't think there is a mailing list for JNDI here but given that this 
seems to be an issue with the DNS provider, then net-dev would be a good 
place to bring it up. It's possible that when the support for using the 
host's resolver configuration was added that the IPv6 name server case 
wasn't tested.

-Alan


More information about the jdk7-dev mailing list