Package: io.vertx.groovy.core.dns

## [Groovy] Class DnsClient

- io.vertx.groovy.core.dns.DnsClient

- Provides a way to asynchronously lookup information from DNS servers.

  Please consult the documentation for more information on DNS clients.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `DnsClient (java.lang.Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `java.lang.Object` | `getDelegate()`
    `DnsClient` | `lookup(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> handler)` Try to lookup the A (ipv4) or AAAA (ipv6) record for the given name.
    `DnsClient` | `lookup4(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> handler)` Try to lookup the A (ipv4) record for the given name.
    `DnsClient` | `lookup6(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> handler)` Try to lookup the AAAA (ipv6) record for the given name.
    `DnsClient` | `resolveA(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.lang.String>>> handler)` Try to resolve all A (ipv4) records for the given name.
    `DnsClient` | `resolveAAAA(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.lang.String>>> handler)` Try to resolve all AAAA (ipv6) records for the given name.
    `DnsClient` | `resolveCNAME(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.lang.String>>> handler)` Try to resolve the CNAME record for the given name.
    `DnsClient` | `resolveMX(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<MxRecord>>> handler)` Try to resolve the MX records for the given name.
    `DnsClient` | `resolveNS(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.lang.String>>> handler)` Try to resolve the NS records for the given name.
    `DnsClient` | `resolvePTR(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> handler)` Try to resolve the PTR record for the given name.
    `DnsClient` | `resolveSRV(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<SrvRecord>>> handler)` Try to resolve the SRV records for the given name.
    `DnsClient` | `resolveTXT(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.lang.String>>> handler)` Try to resolve the TXT records for the given name.
    `DnsClient` | `reverseLookup(java.lang.String ipaddress, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> handler)` Try to do a reverse lookup of an IP address.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### DnsClient(java.lang.Object delegate)

  - ### Method Detail

    - #### java.lang.Object getDelegate()

    - #### DnsClient lookup(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> handler)

      Try to lookup the A (ipv4) or AAAA (ipv6) record for the given name. The first found will be used.

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `name` - the name to resolve
        `handler` - the io.vertx.groovy.core.Handler to notify with the io.vertx.groovy.core.AsyncResult. The handler will get notified with the resolved address if a record was found. If non was found it will get notifed with `null`. If an error accours it will get failed.

    - #### DnsClient lookup4(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> handler)

      Try to lookup the A (ipv4) record for the given name. The first found will be used.

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `name` - the name to resolve
        `handler` - the to notify with the io.vertx.groovy.core.AsyncResult. The handler will get notified with the resolved java.net.Inet4Address if a record was found. If non was found it will get notifed with `null`. If an error accours it will get failed.

    - #### DnsClient lookup6(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> handler)

      Try to lookup the AAAA (ipv6) record for the given name. The first found will be used.

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `name` - the name to resolve
        `handler` - the to notify with the . The handler will get notified with the resolved java.net.Inet6Address if a record was found. If non was found it will get notifed with `null`. If an error accours it will get failed.

    - #### DnsClient resolveA(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.lang.String>>> handler)

      Try to resolve all A (ipv4) records for the given name.

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `name` - the name to resolve
        `handler` - the io.vertx.groovy.core.Handler to notify with the io.vertx.groovy.core.AsyncResult. The handler will get notified with a java.util.List that contains all the resolved java.net.Inet4Addresses. If none was found an empty java.util.List will be used. If an error accours it will get failed.

    - #### DnsClient resolveAAAA(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.lang.String>>> handler)

      Try to resolve all AAAA (ipv6) records for the given name.

      Returns:
        a reference to this, so the API can be used fluently
      Parameters:
        `name` - the name to resolve
        `handler` - the io.vertx.groovy.core.Handler to notify with the io.vertx.groovy.core.AsyncResult. The handler will get notified with a java.util.List that contains all the resolved java.net.Inet6Addresses. If none was found an empty java.util.List will be used. If an error accours it will get failed.

    - #### DnsClient resolveCNAME(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.lang.String>>> handler)

      Try to resolve the CNAME record for the given name.

      Returns:
        a reference to this, so the API can be used fluently.
      Parameters:
        `name` - the name to resolve the CNAME for
        `handler` - the to notify with the . The handler will get notified with the resolved java.lang.String if a record was found. If none was found it will get notified with `null`. If an error accours it will get failed.

    - #### DnsClient resolveMX(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<MxRecord>>> handler)

      Try to resolve the MX records for the given name.

      Returns:
        a reference to this, so the API can be used fluently.
      Parameters:
        `name` - the name for which the MX records should be resolved
        `handler` - the io.vertx.groovy.core.Handler to notify with the io.vertx.groovy.core.AsyncResult. The handler will get notified with a List that contains all resolved MxRecords, sorted by their MxRecord.priority. If non was found it will get notified with an empty java.util.List. If an error accours it will get failed.

    - #### DnsClient resolveNS(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.lang.String>>> handler)

      Try to resolve the NS records for the given name.

      Returns:
        a reference to this, so the API can be used fluently.
      Parameters:
        `name` - the name for which the NS records should be resolved
        `handler` - the to notify with the . The handler will get notified with a List that contains all resolved java.lang.Strings. If none was found it will get notified with an empty java.util.List. If an error accours it will get failed.

    - #### DnsClient resolvePTR(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> handler)

      Try to resolve the PTR record for the given name.

      Returns:
        a reference to this, so the API can be used fluently.
      Parameters:
        `name` - the name to resolve the PTR for
        `handler` - the to notify with the . The handler will get notified with the resolved java.lang.String if a record was found. If none was found it will get notified with `null`. If an error accours it will get failed.

    - #### DnsClient resolveSRV(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<SrvRecord>>> handler)

      Try to resolve the SRV records for the given name.

      Returns:
        a reference to this, so the API can be used fluently.
      Parameters:
        `name` - the name for which the SRV records should be resolved
        `handler` - the to notify with the . The handler will get notified with a List that contains all resolved SrvRecords. If none was found it will get notified with an empty java.util.List. If an error accours it will get failed.

    - #### DnsClient resolveTXT(java.lang.String name, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.util.List<java.lang.String>>> handler)

      Try to resolve the TXT records for the given name.

      Returns:
        a reference to this, so the API can be used fluently.
      Parameters:
        `name` - the name for which the TXT records should be resolved
        `handler` - the to notify with the . The handler will get notified with a List that contains all resolved java.lang.Strings. If none was found it will get notified with an empty java.util.List. If an error accours it will get failed.

    - #### DnsClient reverseLookup(java.lang.String ipaddress, io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.String>> handler)

      Try to do a reverse lookup of an IP address. This is basically the same as doing trying to resolve a PTR record but allows you to just pass in the IP address and not a valid ptr query string.

      Returns:
        a reference to this, so the API can be used fluently.
      Parameters:
        `ipaddress` - the IP address to resolve the PTR for
        `handler` - the to notify with the . The handler will get notified with the resolved java.lang.String if a record was found. If none was found it will get notified with `null`. If an error accours it will get failed.