|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.net.DNS
public class DNS
A class that provides direct and reverse lookup functionalities, allowing the querying of specific network interfaces or nameservers.
Constructor Summary | |
---|---|
DNS()
|
Method Summary | |
---|---|
static java.lang.String |
getDefaultHost(java.lang.String strInterface)
Returns the default (first) host name associated by the default nameserver with the address bound to the specified network interface |
static java.lang.String |
getDefaultHost(java.lang.String strInterface,
java.lang.String nameserver)
Returns the default (first) host name associated by the provided nameserver with the address bound to the specified network interface |
static java.lang.String |
getDefaultIP(java.lang.String strInterface)
Returns the first available IP address associated with the provided network interface |
static java.lang.String[] |
getHosts(java.lang.String strInterface)
Returns all the host names associated by the default nameserver with the address bound to the specified network interface |
static java.lang.String[] |
getHosts(java.lang.String strInterface,
java.lang.String nameserver)
Returns all the host names associated by the provided nameserver with the address bound to the specified network interface |
static java.lang.String[] |
getIPs(java.lang.String strInterface)
Returns all the IPs associated with the provided interface, if any, in textual form. |
static java.lang.String |
reverseDns(java.net.InetAddress hostIp,
java.lang.String ns)
Returns the hostname associated with the specified IP address by the provided nameserver. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DNS()
Method Detail |
---|
public static java.lang.String reverseDns(java.net.InetAddress hostIp, java.lang.String ns) throws javax.naming.NamingException
hostIp
- The address to reverse lookupns
- The host name of a reachable DNS server
javax.naming.NamingException
- If a NamingException is encounteredpublic static java.lang.String[] getIPs(java.lang.String strInterface) throws java.net.UnknownHostException
strInterface
- The name of the network interface to query (e.g. eth0)
java.net.UnknownHostException
- If an UnknownHostException is encountered in querying the
default interfacepublic static java.lang.String getDefaultIP(java.lang.String strInterface) throws java.net.UnknownHostException
strInterface
- The name of the network interface to query (e.g. eth0)
java.net.UnknownHostException
- If one is encountered in querying the default interfacepublic static java.lang.String[] getHosts(java.lang.String strInterface, java.lang.String nameserver) throws java.net.UnknownHostException
strInterface
- The name of the network interface to query (e.g. eth0)nameserver
- The DNS host name
java.net.UnknownHostException
public static java.lang.String[] getHosts(java.lang.String strInterface) throws java.net.UnknownHostException
strInterface
- The name of the network interface to query (e.g. eth0)
java.net.UnknownHostException
- If one is encountered while querying the deault interfacepublic static java.lang.String getDefaultHost(java.lang.String strInterface, java.lang.String nameserver) throws java.net.UnknownHostException
strInterface
- The name of the network interface to query (e.g. eth0)nameserver
- The DNS host name
java.net.UnknownHostException
- If one is encountered while querying the deault interfacepublic static java.lang.String getDefaultHost(java.lang.String strInterface) throws java.net.UnknownHostException
strInterface
- The name of the network interface to query (e.g. eth0)
java.net.UnknownHostException
- If one is encountered while querying the deault interface
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |