- All Known Implementing Classes:
DirContextDnsResolver,DnsResolvers
public interface DnsResolver
Users may implement this interface to override the normal DNS lookup offered by the OS.
- Since:
- 4.2
- Author:
- Mark Paluch
-
Method Summary
Modifier and Type Method Description static DnsResolverjvmDefault()Java VM default resolver.InetAddress[]resolve(String host)Returns the IP address for the specified host name.static DnsResolverunresolved()Non-resolvingDnsResolver.
-
Method Details
-
jvmDefault
Java VM default resolver.- Since:
- 5.1
-
unresolved
Non-resolvingDnsResolver. Returns an emptyInetAddressto indicate an unresolved address.- Since:
- 5.1
- See Also:
InetSocketAddress.createUnresolved(String, int)
-
resolve
Returns the IP address for the specified host name.- Parameters:
host- the hostname, must not be empty ornull.- Returns:
- array of one or more
adresses. An empty array indicates that DNS resolution is not supported by thisDnsResolverand should happen by netty, seeInetSocketAddress.createUnresolved(String, int). - Throws:
UnknownHostException- if the given host is not recognized or the associated IP address cannot be used to build anInetAddressinstance
-