mojira.dev
MC-161678

Long time of handling IPs without hostname (in server list)

Updating server list tooks ~3 seconds to get status for almost all servers, the same when connecting to the server.

Recently I've run server in cloud. It took 15 seconds to get status or connect to it. First i figured out that setting Google DNS (in my local machine, not in cloud) reduces this time to ~5 secs. Other servers still less than 3 secs. So not a solution.

Then I've observed that other servers have domain name binded to IP address. My server didn't have that so I've get free domain and bind it to my server IP. Then in minecraft i add server using this hostname and problem seems fixed, timings described above become less than 3 sec.

But add server by IP and you got this problem again. That's because there is magic PTR record related to DNS which my server don't have unlike other servers. This record made possible "reverse dns lookup" which gives hostname for certain IP.

I hope the problem clear now, at some point minecraft client tries to get hostname, so if you add server by IP client will do "reverse dns lookup" to find hostname by IP. So in case you dont have PTR record you're in trouble with bad timings like me, because only IP provider can create such records.

 

Please read method description: java.net.InetAddress#getHostName()

This method as described do 'reverse lookup'.  And called from minecraft's NetworkManager -> createNetworkManagerAndConnect -> connect method from netty framework which eventually do call getHostName.

 

I attach 6 lines script so you can reproduce, you need just get server with proper 'raw' IP address without hostname related to it or PTR records. Though as i said it also depends on DNS you have on your PC. 

This seems not a bug but improvement though. Sorry for TL;DR and thanks for great game.
 

Linked issues

Attachments

Comments

Arisa Bot

Thank you for your report!
We're tracking this issue in MC-125762, so this ticket is being resolved and linked as a duplicate.

If you would like to add a vote and any extra information to the main ticket it would be appreciated.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! Please report any issues on Discord or Reddit

Evgeniy

(Unassigned)

Unconfirmed

(Unassigned)

1.14.4

Retrieved