DNSResolverDefault

public class DNSResolverDefault implements DNSResolverIfc

DNSResolver class for handling DNS names

Fields

ip_cache

public static Map<String, DNSEntry> ip_cache

srv_cache

public static Map<String, DNSEntry[]> srv_cache

Constructors

DNSResolverDefault

protected DNSResolverDefault()

Methods

getDefaultHost

public String getDefaultHost()

getDefaultHosts

public String[] getDefaultHosts()

getHostIPs

public String[] getHostIPs(String hostname)

Resolve all IP addresses for the given hostname

Parameters:
  • hostname – the domain name for which this record is valid
Returns:

Array of all IP addresses on which target host provide service.

getHostSRV_Entries

public DNSEntry[] getHostSRV_Entries(String hostname, String service, int defPort)

getPrimaryHost

public String getPrimaryHost()

getSecondaryHost

public String getSecondaryHost()

isHostValid

protected static boolean isHostValid(String host)

main

public static void main(String[] args)

main method outputting various information about hostnames

Parameters:
  • args – a String[] containing domains to query, if none provided default one will be used

setPrimaryHost

public void setPrimaryHost(String tigasePrimaryHost)

setSecondaryHost

public void setSecondaryHost(String tigaseSecondaryHost)