mojira.dev
MC-49826

DNS SRV records used randomy regardless of their priority

Short description

how to reproduce:

  • use "nerdpol.org" in server name field.

  • refresh server view or connect to the server

expected behaviour:

  • minecraft looks up the SRV record and receives two results with different priority

  • a connection is opened to minecraft.nerdpol.org:25565

  • if the connection to minecraft.nerdpol.org:25565 fails a connection to minecraft.nerdpol.org:53 is opened

actual behaviour:

  • minecraft looks up the SRV record and receives two results with different priority

  • a connection to minecraft.nerdpol.org:25565 or minecraft.nerdpol.org:53 is opened randomly, ignoring the given priorities

Long description

I just noticed that minecraft randomly chooses one of the received DNS SRV records on each connect regardless of their priority values. This behaviour seems to apply to the server overview as well as to the actual connect.

Normally an application would connect to the specified host with the lowest given value in the priority field. A lower value means a higher priority.

I've set up two SRV records with different priorities in the domain nerdpol.org. The first record has a priority of 0 and leads to the default minecraft port 25565. The second record has a priority of 53 and leads to the port 53. This is for cases where users have no access to port 25565 from within their network. Port 53 leads to the very same server/port via a iptables redirect.

bind9 SRV records

_minecraft._tcp.nerdpol.org. 86400 IN SRV 53 0 53 minecraft.nerdpol.org.
_minecraft._tcp.nerdpol.org. 86400 IN SRV 0 0 25565 minecraft.nerdpol.org.

Some repeated connects and disconnects as seen in the Development Console

[14:31:19 INFO]: Client> [14:31:19] [Client thread/INFO]: Connecting to minecraft.nerdpol.org., 53
[14:31:44 INFO]: Client> [14:31:44] [Client thread/INFO]: Connecting to minecraft.nerdpol.org., 25565
[14:31:50 INFO]: Client> [14:31:50] [Client thread/INFO]: Connecting to minecraft.nerdpol.org., 53
[14:31:55 INFO]: Client> [14:31:55] [Client thread/INFO]: Connecting to minecraft.nerdpol.org., 25565
[14:32:01 INFO]: Client> [14:32:01] [Client thread/INFO]: Connecting to minecraft.nerdpol.org., 25565
[14:32:08 INFO]: Client> [14:32:08] [Client thread/INFO]: Connecting to minecraft.nerdpol.org., 25565
[14:32:08 INFO]: Client> [14:32:08] [Client thread/INFO]: Connecting to minecraft.nerdpol.org., 53
[14:32:09 INFO]: Client> [14:32:09] [Client thread/INFO]: Connecting to minecraft.nerdpol.org., 53

excerpt from rfc2782

Priority
The priority of this target host. A client MUST attempt to
contact the target host with the lowest-numbered priority it can
reach; target hosts with the same priority SHOULD be tried in an
order defined by the weight field. The range is 0-65535. This
is a 16 bit unsigned integer in network byte order.

Weight

...
...
...
This process is repeated for each
Priority.

see: https://www.ietf.org/rfc/rfc2782.txt

Would be great to have this fixed. At least for our use case the impact of this behaviour isn't that hard so the priority of this bug report isn't very high either. 🙂

Linked issues

Comments 23

Is this still a concern in the current Minecraft version 1.7.9 / Launcher version 1.3.11 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Is this still a concern in the current Minecraft version 14w30c or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Please reopen this issue as it's still relevant for Minecraft 1.8.

I always wonder how mods and developers handle bugs, as if it were the reporters job to keep information up to date and test all sort of things. You should be clear on the fact, that it is your project. People pay for it and you should be thankful for anyone reporting bugs. It is your job to test, find and fix. Bugs usually don't fix themselves, so there is no reason to ask if something is still an issue in any later version. If no one has worked on it, it will! You can use your version control system to find out if there have been changes to relevant code sections. Users are not responsible for bugs in your project and don't have to care to get them fixed. If a product is full of bugs people will get frustrated and don't pay for it any longer. It is in your interesst to get any bugs fixed.

Because we manage such a vast quantity of open tickets, we leave it to the reporters to maintain the validity of each individual ticket. It is not reasonable to test all 4,000 tickets every time a new version comes out. This way, each person is responsible for one, or just a few, tickets, rather than a few people being responsible for all the tickets.

The truth is that while bugs do not fix themselves, they are sometimes *accidentally* fixed. We have had numerous instances where bugs are fixed without the developers intentionally going in and fixing that particular bug, often due to changes in other areas of the code.

Lastly, moderators don't fix the bugs. We moderate the bug reporter. It's in our title.

13 more comments

Confirmed in 1.14.2

Is this still an issue in 21w20a or later?

Confirmed in 1.18.2. Not random for me in short term. But inconsistent in different time. Code review find out SRV processing just ignore priority. For SRV record, only take port and address for the first item in records list. Records list is an unsorted list and not even ensuring the highest priority record in the first item. Code is similar to the code posted in privious comment.

Can confirm in 25w03a. I would also like to request ownership of this report to be able to maintain it

Norbert Fischer

(Unassigned)

Community Consensus

Platform

Low

Networking

DNS, SRV

Minecraft 1.7.4, Minecraft 1.7.5, Minecraft 1.7.9, Minecraft 1.8, Minecraft 1.8.8, ..., Minecraft 15w47c, Minecraft 1.10.2, Minecraft 1.14.1, Minecraft 1.14.2, 1.18.2

Retrieved