Package io.lettuce.core.resource
Interface DnsResolver
-
- 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
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static DnsResolver
jvmDefault()
Java VM default resolver.InetAddress[]
resolve(String host)
Returns the IP address for the specified host name.static DnsResolver
unresolved()
Non-resolvingDnsResolver
.
-
-
-
Method Detail
-
jvmDefault
static DnsResolver jvmDefault()
Java VM default resolver.- Since:
- 5.1
-
unresolved
static DnsResolver unresolved()
Non-resolvingDnsResolver
. Returns an emptyInetAddress
to indicate an unresolved address.- Since:
- 5.1
- See Also:
InetSocketAddress.createUnresolved(String, int)
-
resolve
InetAddress[] resolve(String host) throws UnknownHostException
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 thisDnsResolver
and 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 anInetAddress
instance
-
-