fast-ip-ping

fast-ip-ping

Mod

Yeet the laggy reversed DNS lookup for pure IP server addresses

Client Optimization

235.4k downloads
134 followers
Created8 months ago
Updated4 months ago

Follow Save
Host your Minecraft server on BisectHosting - get 25% off your first month with code MODRINTH.

pinging

Yeet the laggy reversed DNS lookup for pure IP server addresses

Extracted from the yeetServerIpReversedDnsLookup option in TweakerMore Mod

What & Why & How

For servers whose addresses are represented solely by IP, e.g. 192.168.2.10:25565, disable reverse DNS lookups in the corresponding InetAddress object

Many non-loopback IPs lack associated domain names, which makes reverse lookups time-consuming

// java.net.InetAddress.getHostName(boolean)
String getHostName(boolean check) {
    if (holder().getHostName() == null) {  // It will be null if InetAddress.getByName() received a pure IP 
        holder().hostName = InetAddress.getHostFromNameService(this, check);  // <-- takes forever
    }
    return holder().getHostName();
}

This option sets the domain of those servers directly to their IP, bypassing the reverse DNS check

This results in a 1s ~ 5s reduction in time for servers with pure IP address. Affects the following environments:

  • Pinging the server in the server list screen
  • Connecting to the server

Environment

  • Client-side only
  • Fabric / Forge mod loader. No extra requirement is needed

External resources



Project members

fallen-breath

Owner


Technical information

License
LGPL-3.0-only
Client side
required
Server side
unsupported
Project ID