org.apache.hc.client5.http

## Class SystemDefaultDnsResolver

- java.lang.Object
- - org.apache.hc.client5.http.SystemDefaultDnsResolver

- All Implemented Interfaces:
    DnsResolver

      public class SystemDefaultDnsResolver
      extends Object
      implements DnsResolver

  DNS resolver that uses the default OS implementation for resolving host names.
  Since:
    4.2

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static SystemDefaultDnsResolver` | `INSTANCE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SystemDefaultDnsResolver()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `InetAddress[]` | `resolve(String host)` Returns the IP address for the specified host name, or null if the given host is not recognized or the associated IP address cannot be used to build an InetAddress instance.
    `String` | `resolveCanonicalHostname(String host)` Gets the fully qualified domain name for given host name.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### INSTANCE

          public static final SystemDefaultDnsResolver INSTANCE

  - ### Constructor Detail

    - #### SystemDefaultDnsResolver

          public SystemDefaultDnsResolver()

  - ### Method Detail

    - #### resolve

          public InetAddress[] resolve(String host)
                                throws UnknownHostException

      Description copied from interface: `DnsResolver`
      Returns the IP address for the specified host name, or null if the given host is not recognized or the associated IP address cannot be used to build an InetAddress instance.
      Specified by:
        `resolve` in interface `DnsResolver`
      Parameters:
        `host` - The host name to be resolved by this resolver.
      Returns:
        The IP address associated to the given host name, or null if the host name is not known by the implementation class.
      Throws:
        `UnknownHostException`
      See Also:
        `InetAddress`

    - #### resolveCanonicalHostname

          public String resolveCanonicalHostname(String host)
                                          throws UnknownHostException

      Description copied from interface: `DnsResolver`
      Gets the fully qualified domain name for given host name.
      Specified by:
        `resolveCanonicalHostname` in interface `DnsResolver`
      Throws:
        `UnknownHostException`

Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.