Minecraft does not query for SRV records when the client machine has static IP on its local network (typical LAN), not using DHCP.
As a result there is displayed the standard message "Can't connect to server" and I can't play on the server.
I observed this on versions 1.16.5 and 1.16.3, but it looks like earlier versions also may be affected.
In my case I configured the static IP as a Preferred IP on the client-side, because I have no access to the router to try configure the static IP on the router-side and then use DHCP on the client-side. (This is not so unusual situation: we want to use static IPs on the LAN but the router is leased from ISP and also managed by ISP.)
I sniffed the DNS packets using Wireshark and found that only A queries were made when the client had static IP.
As an example Minecraft server I used cubesurv.pl, which is real & working server, but available only by using SRV record.
I attached 4 TEXT files containing sniffed DNS packets:
=> 2 "LAN-cable-*.txt" files show tests on a cable-LAN,
=> 2 "Mobile-Hotspot-*.txt" files show tests on a mobile hotspot (prepared from my phone).
For comparison there are included sniffed DNS packets for static IP (faulty) and DHCP (work as expected).
I hope the files show everything in details, so there is no need to describe the faulty behavior.
I would only like to point something in "Mobile-Hotspot-*.txt" that seems to be a strange or not clear.
The config for the mobile-hotspot network was following:
IP/subnet: 192.168.43.xxx/24
DNS server: 192.168.43.1
"Mobile-Hotspot-DHCP.txt" shows that there were made 2 SRV queries: into 192.168.1.1 and 192.168.43.1 .
"Mobile-Hotspot-Static-IP.txt" shows that there was made 1 SRV query: into 192.168.1.1 .
Query to DNS IP = 192.168.1.1 is faulty of course, because (in mobile-hotspot config) the network 192.168.1.xxx/24 does not exist in the system at all.
So I would like also ask for explanation why MC does query to 192.168.1.1 DNS server ?
Does MC assume this IP as a "default" or "always worth a try" address ?
Attachments
Comments 5
I checked this several times in versions 1.17 and 1.17.1 and now it looks like the problem has gone 😉
However I think that someone from Dev or Test team could confirm that this issue was really repaired, because I haven't found any issue fixed in 1.17/1.17.1 that would be related to the original problem I reported.
If I recall correctly, Mojang reworked some of the SRV record logic in 1.17 for unrelated reasons (I don't know if there's a public report for it), so it seems plausible that it's fixed in 1.17. I don't know the exact version this was changed in, so I'm resolving as "cannot reproduce". (I haven't attempted to test it myself.)
For anyone interested in this issue - there is a discussion thread about that problem on the official Minecraft Forum :
Does Minecraft client need a DHCP server on LAN to work properly ? (Problem: no query for DNS SRV records) - Java Edition Support - Support - Minecraft Forum
https://www.minecraftforum.net/forums/support/java-edition-support/3057536-does-minecraft-client-need-a-dhcp-server-on-lan-to