org.xbill.DNS
Class dns

java.lang.Object
  extended byorg.xbill.DNS.dns

public final class dns
extends Object

A high level API for mapping queries to DNS Records.

As of dnsjava 1.4.0, all functions in this class are wrappers around functions in the Lookup and ReverseMap class, and those should be used instead.

Author:
Brian Wellington
See Also:
Lookup, ReverseMap

Method Summary
static Record[] getAnyRecords(String namestr, int type)
          Finds any records with the given name and type in class IN
static Record[] getAnyRecords(String namestr, int type, int dclass)
          Finds any records with the given name, type, and class
static Record[] getAnyRecordsByAddress(String addr, int type)
          Finds any records for the given dotted quad address and type in class IN
static Cache getCache()
          Obtains the (class IN) Cache used by functions in the dns class.
static Cache getCache(int dclass)
          Obtains the Cache used by functions in the dns class.
static Record[] getRecords(String namestr, int type)
          Finds credible records with the given name and type in class IN
static Record[] getRecords(String namestr, int type, int dclass)
          Finds credible records with the given name, type, and class
static Record[] getRecords(String namestr, int type, int dclass, int cred)
          Finds records with the given name, type, and class with a certain credibility
static Record[] getRecordsByAddress(String addr, int 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. Unlike the Lookup setSearchPath function, this will silently ignore invalid names.

See Also:
FindServer

getCache

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

Parameters:
dclass - The dns class of data in the cache

getCache

public static Cache getCache()
Obtains the (class IN) 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,
                                  int type,
                                  int dclass,
                                  int 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,
                                  int type,
                                  int 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,
                                     int type,
                                     int 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 namestr,
                                  int 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 namestr,
                                     int 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,
                                           int 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,
                                              int 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