net.dns
Class Dns
java.lang.Object
net.dns.Dns
public class Dns
- extends java.lang.Object
Constructor Summary |
Dns()
|
Method Summary |
static java.lang.String |
getHostName(java.lang.String s)
get the host name for this IP addBk.address. |
static java.net.InetAddress |
getLocalHost()
|
static byte[] |
getNumericAddress(java.lang.String name)
map the host name to an IP addBk.address. |
static void |
main(java.lang.String[] args)
|
static void |
print(byte[] IP)
print out a well formatted dot notation for an array
of byte. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Dns
public Dns()
getLocalHost
public static java.net.InetAddress getLocalHost()
throws java.net.UnknownHostException
- Throws:
java.net.UnknownHostException
main
public static void main(java.lang.String[] args)
throws java.net.UnknownHostException
- Throws:
java.net.UnknownHostException
getHostName
public static java.lang.String getHostName(java.lang.String s)
- get the host name for this IP addBk.address.
getNumericAddress
public static byte[] getNumericAddress(java.lang.String name)
- map the host name to an IP addBk.address.
return the address of the fully qualified
domain name. For example:
192.68.1.90 = show.docjava.com.com
Failure occurs if the DNS is down!
print
public static void print(byte[] IP)
- print out a well formatted dot notation for an array
of byte. For example: 192.168.1.1