echo "import java.net.InetAddress; \
public class HostnameFromIp { \
public static void main(String[] args) throws Exception { \
var startTime = System.currentTimeMillis(); \
System.out.println(InetAddress.getByName(args[0]).getHostName() + \
\" - \" + (System.currentTimeMillis() - startTime) + \"ms\"); \
} \
}" > HostnameFromIp.java
javac HostnameFromIp.java
java HostnameFromIp 8.8.8.8
Last active
August 12, 2024 14:50
-
-
Save hardyscc/ad6badbdf669a063920f7f7f48ad2880 to your computer and use it in GitHub Desktop.
HostnameFromIp.java
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment