public final class DnsUtil extends Object
Modifier and Type | Method and Description |
---|---|
static List<Attribute> |
getAllAttributes(String hostName)
Gets all attributes of the supplied hostName.
|
static Attribute |
getAttribute(String hostName,
String attributeName)
Gets a single attribute from the supplied hostName.
|
static List<MailServer> |
getMailServers(String hostName)
Gets the mail servers of the supplied hostName.
|
static com.sun.jndi.dns.DnsContext |
lookup(String hostName)
Performs a lookup of the supplied hostName.
|
static void |
main(String[] args)
For demonstration purposes only.
|
public static com.sun.jndi.dns.DnsContext lookup(String hostName) throws NamingException
hostName
- Host name to lookup.NamingException
- When the supplied hostName could not be looked up.public static List<MailServer> getMailServers(String hostName) throws NamingException
hostName
- Host name.NamingException
- When the supplied hostName could not be looked up.public static Attribute getAttribute(String hostName, String attributeName) throws NamingException
hostName
- Host name.attributeName
- Name of the attribute to get.NamingException
- When the attribute could not be looked up.
public static List<Attribute> getAllAttributes(String hostName) throws NamingException
hostName
- Host name.NamingException
- When the supplied hostName could not be looked up.public static void main(String[] args) throws NamingException
args
- Not used.NamingException
- When a DNS lookup error occurs.Copyright © 2008–2018. All rights reserved.