|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.lavantech.net.dns.SimpleDNSLookup
SimpleDNSLookup class provides simple methods to perform most common DNS lookups. If you are looking for more functionality, see DNSLookup class. Here are some examples of its use.
InetAddress addr = SimpleDNSLookup.getInetAddress("www.hotmail.com");
String hostname = SimpleDNSLookup.getHostName(addr);
String mailExchange = SimpleDNSLookup.getMailExchange("hotmail.com");
DNSLookup
Field Summary | |
static int |
timeout
Timeout for DNS lookup for all static methods in this class. |
Constructor Summary | |
SimpleDNSLookup()
|
Method Summary | |
static java.lang.String |
getCanonicalName(java.lang.String hostname)
Returns the Canonical Name for a given hostname. |
static java.lang.String |
getDomainAdminMailBox(java.lang.String domain)
Returns the admin email id for the given domain. |
static java.lang.String |
getHostName(java.net.InetAddress addr)
Returns the hostname for a given IP Address. |
static java.net.Inet6Address |
getInet6Address(java.lang.String hostname)
Returns the IPv6 address for a given hostname. |
static java.net.InetAddress |
getInetAddress(java.lang.String hostname)
Returns an IP Address for a given hostname. |
static java.lang.String |
getMailExchange(java.lang.String domain)
Returns the mail exchange for a given domain. |
static java.lang.String |
getNameServerForDomain(java.lang.String domain)
Returns the Name Server for a given domain. |
static java.lang.String |
getTextInformation(java.lang.String hostname)
Returns the text information for the given hostname. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int timeout
Constructor Detail |
public SimpleDNSLookup()
Method Detail |
public static java.net.InetAddress getInetAddress(java.lang.String hostname) throws java.lang.Exception
hostname
- Hostname for which the IP address should be returned.
java.net.SocketTimeoutException
- If the response is not received within the timeout period.
java.lang.Exception
- If the Name Server can't be determined or any other internal error occurs.public static java.lang.String getHostName(java.net.InetAddress addr) throws java.lang.Exception
addr
- IPAddress for which the hostname should be returned.
java.net.SocketTimeoutException
- If the response is not received within the timeout period.
java.lang.Exception
- If the Name Server can't be determined or any other internal error occurs.public static java.lang.String getMailExchange(java.lang.String domain) throws java.lang.Exception
domain
- Domain for which the responsible Mail Exchange should be returned.
java.net.SocketTimeoutException
- If the response is not received within the timeout period.
java.lang.Exception
- If the Name Server can't be determined or any other internal error occurs.public static java.net.Inet6Address getInet6Address(java.lang.String hostname) throws java.lang.Exception
hostname
- Hostname for which the IPv6 address should be returned.
java.net.SocketTimeoutException
- If the response is not received within the timeout period.
java.lang.Exception
- If the Name Server can't be determined or any other internal error occurs.public static java.lang.String getCanonicalName(java.lang.String hostname) throws java.lang.Exception
hostname
- Hostname for which the Canonical name should be returned.
java.net.SocketTimeoutException
- If the response is not received within the timeout period.
java.lang.Exception
- If the Name Server can't be determined or any other internal error occurs.public static java.lang.String getNameServerForDomain(java.lang.String domain) throws java.lang.Exception
domain
- Domain for which the Name Server should be returned.
java.net.SocketTimeoutException
- If the response is not received within the timeout period.
java.lang.Exception
- If the Name Server can't be determined or any other internal error occurs.public static java.lang.String getDomainAdminMailBox(java.lang.String domain) throws java.lang.Exception
domain
- Domain for which the administrator's email should be returned.
java.net.SocketTimeoutException
- If the response is not received within the timeout period.
java.lang.Exception
- If the Name Server can't be determined or any other internal error occurs.public static java.lang.String getTextInformation(java.lang.String hostname) throws java.lang.Exception
hostname
- Hostname for which the text information should be returned.
java.net.SocketTimeoutException
- If the response is not received within the timeout period.
java.lang.Exception
- If the Name Server can't be determined or any other internal error occurs.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |