mojira.dev
MC-31433

Minecraft does not resolve SRV records when a ipv6 dns resolver is present

When trying to resolve srv records. The default dns value for the resolver returns a ipv6 address, which it was not expecting causing a NumberFormatException. Making any srv record resolving fail. The exception is not displayed without code modification to print the stack trace.

java.lang.NumberFormatException: For input string: "4860:4860::8888"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:458)
at java.lang.Integer.parseInt(Integer.java:499)
at com.sun.jndi.dns.DnsClient.<init>(DnsClient.java:103)
at com.sun.jndi.dns.Resolver.<init>(Resolver.java:44)
at com.sun.jndi.dns.DnsContext.getResolver(DnsContext.java:553)
at com.sun.jndi.dns.DnsContext.c_getAttributes(DnsContext.java:413)
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_getAttributes(ComponentDirContext.java:213)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(PartialCompositeDirContext.java:121)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(PartialCompositeDirContext.java:109)
at javax.naming.directory.InitialDirContext.getAttributes(InitialDirContext.java:123)
at net.minecraft.src.ServerAddress.getServerAddress(ServerAddress.java:92)
at net.minecraft.src.ServerAddress.func_78860_a(ServerAddress.java:70)
at net.minecraft.src.GuiMultiplayer.func_74017_b(GuiMultiplayer.java:367)
at net.minecraft.src.GuiMultiplayer.func_82291_a(GuiMultiplayer.java:593)
at net.minecraft.src.ThreadPollServers.run(ThreadPollServers.java:40)

Linked issues

Comments 17

This is not fixed. i have encountered this problem before months and i searched for a solution since then. i turned ipv6 support of on my OS and that fixed it but it would be nice if i wouldn't have to decide between ipv6 support on my machine and multiplayer minecraft.

I am very VERY surprised this isn't worked out somehow. I have been trying to set up a SRV and A record so players could use play.mydomain.com for a week and nothing seems to work. But people on PC can use it just fine! But all Macs can't connect. What was even stranger is that Mac users could simply type in the name of the A record and connect! After more anylizing it dawned on me that since I was using the default 25565 port they don't need an srv to resolve the port and using the Arecord name to connect works fine.

Still no one knew what was going on and I just happened across this article today.

Its frustrating as heck when you have everything set up correctly and things are not working lol.

Anyway thanks for posting this, judging from the date i still can't believe this hasn't been addressed.

Also so people setting up srv records for their servers and posting the urls are going to have all mac users not able to connect? that just seems crazy to me.

Please specify what game version(s) (1.7.10 and/or 14w31a) this issue affects, so that the report may be updated accordingly

Im having the trouble with 1.7.10 also I don't know about the ipv6 in the title of the post. Besides trying to use an srv record it just won't resolve on 6 macs I've tried but works just fine with an A record pointing to the server IP using 25565 for the port.

This is not fixed for 1.8 also. The same issue occurred for me.

7 more comments

Is this still an issue in the most recent versions (currently that is 1.10.2, or 16w42a) of Minecraft? If so, please update the affected versions and help us keeping this ticket updated from time to time.

Looks like everything I mentioned broken last year now works in 1.10.2.

I've checked in Wireshark, it's actually sending DNS queries (+SRV ones) and server queries over IPv6. I'm even able to connect to a server over the internet with a horribly flaky 6to4 tunnel (which isn't playable, but that's beside the point)

I'd say it's fixed.

I can confirm it's working as well on a dual stack configuration with both IPv4 and IPv6 resolvers or IPv6 only. I didn't check whether an IPv6 only address for the Minecraft server would work since I set my TTL high enough such that it has yet to expire, but I don't expect to encounter any issues. Minecraft successfully retrieves SRV records as appropriate regardless of which resolver it's using, whereas previously it would fail if any IPv6 resolver were present.

I concur with Ant P. It's fixed.

Edit: Works just as well with SRV+AAAA-only records for the Minecraft host!

It appears to still be a problem in 1.17.1 (I haven't tested any other versions), as I'm getting the following error message when trying to connect to a server with the server address <server name>:

[20:35:57] [Render thread/INFO]: Connecting to <server name>, 25565
[20:36:00] [Server Connector #1/ERROR]: Couldn't connect to server
io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: <server name>/<server IP>:25565

This happens when my network adapter has a manually set IPv6 DNS server (which, for reference, is Cloudflare's 2606:4700:4700::1111 and 2606:4700:4700::1001). If I reset the adapter settings so that it obtains its DNS server address automatically, Minecraft is able to connect to the server without any problem.

Some additional info:

  • My network adapter's IPv4 DNS server is also manually set (to Cloudflare's 1.1.1.1 and 1.0.0.1 - for reference), but this doesn't seem to affect the previously mentioned problem at all.

  • The Minecraft server's domain only has an A record, not an AAAA record - in addition to the standard _minecraft._tcp.<server name> SRV record, naturally, which has a different port value than 25565.

@miwob Is this comment thread the most appropriate place for my above comment, or should I create a new issue?

YukonAppleGeek

(Unassigned)

Community Consensus

DNS, ipv6, multiplayer, srv-record

Minecraft 1.6.3, Minecraft 1.7.2, Minecraft 1.7.9, Minecraft 1.7.10, Minecraft 1.8, Minecraft 1.8.1, Minecraft 1.8.7, Minecraft 1.8.8

Minecraft 1.10.2

Retrieved