Package net.apartium.cocoabeans.utils
Class DNSLookup
java.lang.Object
net.apartium.cocoabeans.utils.DNSLookup
A utility for performing DNS lookups
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDNSLookup(InitialDirContext context) Create a DNSLookup class with custom options -
Method Summary
Modifier and TypeMethodDescriptionPerform a simple forward lookupreverseLookup(InetAddress address) Perform a reverse DNS lookup on given addressstatic DNSLookupCreate a DNSLookup instance with sane defaults
-
Constructor Details
-
DNSLookup
Create a DNSLookup class with custom options- Parameters:
context- initial dir context
-
-
Method Details
-
withDefaultOptions
Create a DNSLookup instance with sane defaults- Returns:
- a new DNSLookup instance
-
reverseLookup
Perform a reverse DNS lookup on given address- Parameters:
address- address to lookup- Returns:
- reverse hostname
- Throws:
NamingException- if a problem has occurred during lookup
-
lookup
Perform a simple forward lookup- Parameters:
hostName- hostname to lookuprecordType- record type- Returns:
- lookup results
- Throws:
NamingException- if there were dns lookup issuesNameNotFoundException- if name is not found
-