README.md

December 5, 2022 ยท View on GitHub

Convert IP into hostname

Description

How do I convert a numeric IP address like 199.1.32.90 into a hostname like star.blackstar.com?

Unfortunately due to an unintended side effect (i.e. a bug) in Java's caching of IP addresses and hostnames, Java 1.0 can't convert numeric IP addresses into hostnames. However this is straightforward in Java 1.1. For example,

(Java FAQ:found on the web at:http://sunsite.unc.edu/javafaq/javafaq.html)

More Info

Submitted On
ByN/A
LevelUnknown
User Rating5.0 (10 globes from 2 users)
CompatibilityJava (JDK 1.1)
CategoryInternet/ Browsers/ HTML
WorldJava
Archive File

Source Code

String hostname = InetAddress.getByName("199.1.32.90").getHostName()