Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-161678

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.14.4
    • None
    • windows 10, java 8
    • Unconfirmed
    • (Unassigned)

      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.
       

            Unassigned Unassigned
            Lopol2010 Evgeniy
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: