org.xbill.DNS
Class dns

java.lang.Object
  |
  +--org.xbill.DNS.dns

public final class dns
extends Object

High level API for mapping queries to DNS Records. Caching is used when possible to reduce the number of DNS requests, and a Resolver is used to perform the queries. A search path can be set or determined by FindServer, which allows lookups of unqualified names.

See Also:
Resolver, FindServer

Method Summary
static Record[] getAnyRecords(String name, short type)
          Finds any records with the given name and type in class IN
static Record[] getAnyRecords(String namestr, short type, short dclass)
          Finds any records with the given name, type, and class
static Record[] getAnyRecordsByAddress(String addr, short type)
          Finds any records for the given dotted quad address and type in class IN
static Cache getCache()
          Obtains the Cache used by functions in the dns class.
static Record[] getRecords(String name, short type)
          Finds credible records with the given name and type in class IN
static Record[] getRecords(String namestr, short type, short dclass)
          Finds credible records with the given name, type, and class
static Record[] getRecords(String namestr, short type, short dclass, byte cred)
          Finds records with the given name, type, and class with a certain credibility
static Record[] getRecordsByAddress(String addr, short type)
          Finds credible records for the given dotted quad address and type in class IN
static Resolver getResolver()
          Obtains the Resolver used by functions in the dns class.
static String inaddrString(InetAddress addr)
          Converts an InetAddress into the corresponding domain name (127.0.0.1 -> 1.0.0.127.IN-ADDR.ARPA.)
static String inaddrString(String s)
          Converts an String containing an IP address in dotted quad form into the corresponding domain name.
static void setResolver(Resolver _res)
          Sets the Resolver to be used by functions in the dns class
static void setSearchPath(String[] domains)
          Specifies the domains which will be appended to unqualified names before beginning the lookup process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

inaddrString

public static String inaddrString(InetAddress addr)
Converts an InetAddress into the corresponding domain name (127.0.0.1 -> 1.0.0.127.IN-ADDR.ARPA.)
Returns:
A String containing the domain name.

inaddrString

public static String inaddrString(String s)
Converts an String containing an IP address in dotted quad form into the corresponding domain name. ex. 127.0.0.1 -> 1.0.0.127.IN-ADDR.ARPA.
Returns:
A String containing the domain name.

setResolver

public static void setResolver(Resolver _res)
Sets the Resolver to be used by functions in the dns class

getResolver

public static Resolver getResolver()
Obtains the Resolver used by functions in the dns class. This can be used to set Resolver properties.

setSearchPath

public static void setSearchPath(String[] domains)
Specifies the domains which will be appended to unqualified names before beginning the lookup process. If this is not set, FindServer will be used.
See Also:
FindServer

getCache

public static Cache getCache()
Obtains the Cache used by functions in the dns class. This can be used to perform more specific queries and/or remove elements.

getRecords

public static Record[] getRecords(String namestr,
                                  short type,
                                  short dclass,
                                  byte cred)
Finds records with the given name, type, and class with a certain credibility
Parameters:
namestr - The name of the desired records
type - The type of the desired records
dclass - The class of the desired records
cred - The minimum credibility of the desired records
Returns:
The matching records, or null if none are found
See Also:
Credibility

getRecords

public static Record[] getRecords(String namestr,
                                  short type,
                                  short dclass)
Finds credible records with the given name, type, and class
Parameters:
namestr - The name of the desired records
type - The type of the desired records
dclass - The class of the desired records
Returns:
The matching records, or null if none are found

getAnyRecords

public static Record[] getAnyRecords(String namestr,
                                     short type,
                                     short dclass)
Finds any records with the given name, type, and class
Parameters:
namestr - The name of the desired records
type - The type of the desired records
dclass - The class of the desired records
Returns:
The matching records, or null if none are found

getRecords

public static Record[] getRecords(String name,
                                  short type)
Finds credible records with the given name and type in class IN
Parameters:
namestr - The name of the desired records
type - The type of the desired records
Returns:
The matching records, or null if none are found

getAnyRecords

public static Record[] getAnyRecords(String name,
                                     short type)
Finds any records with the given name and type in class IN
Parameters:
namestr - The name of the desired records
type - The type of the desired records
Returns:
The matching records, or null if none are found

getRecordsByAddress

public static Record[] getRecordsByAddress(String addr,
                                           short type)
Finds credible records for the given dotted quad address and type in class IN
Parameters:
addr - The dotted quad address of the desired records
type - The type of the desired records
Returns:
The matching records, or null if none are found

getAnyRecordsByAddress

public static Record[] getAnyRecordsByAddress(String addr,
                                              short type)
Finds any records for the given dotted quad address and type in class IN
Parameters:
addr - The dotted quad address of the desired records
type - The type of the desired records
Returns:
The matching records, or null if none are found