Package org.xbill.DNS
Class ResolverConfig
java.lang.Object
org.xbill.DNS.ResolverConfig
Locates name servers and the search path to be appended to unqualified names.
The following are attempted, in order, until one succeeds.
- dnsjava properties, see
PropertyResolverConfigProvider - On Unix, /etc/resolv.conf is parsed, see
ResolvConfResolverConfigProvider - On Windows, GetAdaptersAddresses is called, see
WindowsResolverConfigProvider - On Android, system properties or the ConnectivityManager are read, see
AndroidResolverConfigProvider - The JNDI DNS Service Provider is queried, see
JndiContextResolverConfigProvider - The sun.net.dns.ResolverConfiguration class is queried, see
SunJvmResolverConfigProvider localhostis used as the nameserver, and the search path is empty.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSystem property name to disableResolverConfigProviderinitialization. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<ResolverConfigProvider> Gets the ordered list of resolver config providers.static ResolverConfigGets the current configurationintndots()Gets the threshold for the number of dots which must appear in a name before it is considered absolute.static voidrefresh()Gets the current configurationReturns all entries in the located search pathserver()Returns the first located serverservers()Returns all located serversstatic voidsetConfigProviders(List<ResolverConfigProvider> providers) Set a new ordered list of resolver config providers.
-
Field Details
-
CONFIGPROVIDER_SKIP_INIT
System property name to disableResolverConfigProviderinitialization.- Since:
- 3.2
- See Also:
-
-
Constructor Details
-
ResolverConfig
public ResolverConfig()
-
-
Method Details
-
getCurrentConfig
Gets the current configuration -
getConfigProviders
Gets the ordered list of resolver config providers.- Since:
- 3.2
-
setConfigProviders
Set a new ordered list of resolver config providers. -
refresh
public static void refresh()Gets the current configuration -
servers
Returns all located servers -
server
Returns the first located server -
searchPath
Returns all entries in the located search path -
ndots
public int ndots()Gets the threshold for the number of dots which must appear in a name before it is considered absolute. The default is1, meaning meaning that if there are any dots in a name, the name will be tried first as an absolute name.Note that ndots can only be configured in a resolv.conf file or the property
PropertyResolverConfigProvider.DNS_NDOTS_PROP.
-