Package com.mongodb.spi.dns
Interface InetAddressResolver
This interface defines operations for looking up host names.
The default resolver for the driver can be customized by deploying an implementation of InetAddressResolverProvider.
-
Method Summary
Modifier and TypeMethodDescriptionlookupByName(String host) Given the name of a host, returns a list of IP addresses of the requested address family associated with a provided hostname.
-
Method Details
-
lookupByName
Given the name of a host, returns a list of IP addresses of the requested address family associated with a provided hostname.The host name can be an IP literal, as with
InetAddress.getAllByName(String)Implementations are encouraged to implement their own caching policies, as there is no guarantee that the caller will implement a cache.
- Parameters:
host- the host- Returns:
- a list of IP addresses for the requested host
- Throws:
UnknownHostException- if no IP addresses for thehostcould be found
-