Given the name of a host, returns a stream of IP addresses of the requested address family associated with a provided hostname.
host
should be a machine name, such as "www.example.com
", not a textual representation of its IP address. No validation is performed on the given host
name: if a textual representation is supplied, the name resolution is likely to fail and UnknownHostException
may be thrown.
The address family type and addresses order are specified by the LookupPolicy
instance. Lookup operation characteristics could be acquired with InetAddressResolver.LookupPolicy.characteristics()
. If InetAddressResolver.LookupPolicy.IPV4
and InetAddressResolver.LookupPolicy.IPV6
characteristics provided then this method returns addresses of both IPV4 and IPV6 families.