public class DNSResolverDefault extends Object implements DNSResolverIfc
Modifier and Type | Field and Description |
---|---|
static Map<String,DNSEntry> |
ip_cache |
static Map<String,DNSEntry[]> |
srv_cache |
rand, TIGASE_PRIMARY_ADDRESS, TIGASE_SECONDARY_ADDRESS
Modifier | Constructor and Description |
---|---|
protected |
DNSResolverDefault() |
Modifier and Type | Method and Description |
---|---|
String |
getDefaultHost()
Method provides default host information for the installation.
|
String[] |
getDefaultHosts()
Method provides an array of all local host informations, by default it
contains defaultHost.
|
String[] |
getHostIPs(String hostname)
Resolve all IP addresses for the given
hostname |
DNSEntry[] |
getHostSRV_Entries(String hostname,
String service,
int defPort)
Retrieves list of DNS entries for given
hostname . |
String |
getSecondaryHost()
Method provides alternative host information for the current instance.
|
static void |
main(String[] args)
main method outputting various information about hostnames |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHostIP, getHostSRV_Entries, getHostSRV_Entry, getHostSRV_Entry, getHostSRV_IP
public static void main(String[] args) throws Exception
main
method outputting various information about hostnamesargs
- a String[]
containing domains to query, if none
provided default one will be usedException
public String[] getDefaultHosts()
DNSResolverIfc
getDefaultHosts
in interface DNSResolverIfc
public String getDefaultHost()
DNSResolverIfc
getDefaultHost
in interface DNSResolverIfc
public String getSecondaryHost()
DNSResolverIfc
getSecondaryHost
in interface DNSResolverIfc
public String[] getHostIPs(String hostname) throws UnknownHostException
hostname
getHostIPs
in interface DNSResolverIfc
hostname
- the domain name for which this record is validIP addresses
on which target host provide
service.UnknownHostException
public DNSEntry[] getHostSRV_Entries(String hostname, String service, int defPort) throws UnknownHostException
DNSResolverIfc
hostname
. Allow specifying
particular type of SRV record.getHostSRV_Entries
in interface DNSResolverIfc
hostname
- the domain name for which this record is validservice
- type of SRV records, for example _xmpp-server._tcp
defPort
- default port number in case DNS records is missing one.UnknownHostException
Copyright © 2017 "Tigase, Inc.". All rights reserved.