1.17.1, 1.18.1, 1.18.2
Windows 10 21H1
Minecraft 1.17.1, Bundled Java 16 (issue persists on AdoptOpenJDK HotSpot 16)
Minecraft is unable to connect to multiplayer server that have ports in SRV DNS records set running on non-default (25565) port causing issues to servers on shared hostings.
After some testing it looks like the problem might be in some defaulting to IPv6 even though it is not present.
In Windows OS, when you go to the Adapter settings and disable the IPv6 protocol, Minecraft is able to correctly resolve the SRV record and connect to the server (see image_2021-07-13_23-42-16.jpg) (sorry it's in czech but hopefully you'll know what dialog window I mean 🙂)
However when the IPv6 protocol is enabled but the IPv6 on the network is not available, the SRV is not working.
During testing I tried changing the DNS server to 18.104.22.168, 22.214.171.124 and CZ.NIC ODVR
126.96.36.199 however the used DNS server did not affect the testing.
There are some users using different internet provider who don't seem to be having the same issue with this DNS setting and can connect correctly.
This issue does not affect those servers running on Minecraft default port 25565.