# Class: DnsClient

## vertx-js/dns_client~ DnsClient

#### new DnsClient()

Provides a way to asynchronously lookup information from DNS servers.

Please consult the documentation for more information on DNS clients.

Source:
  - vertx-js/dns_client.js, line 33

### Methods

#### lookup(name, handler) → {DnsClient}

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

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | the name to resolve
`handler` | function | the Handler to notify with the 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.

Source:
  - vertx-js/dns_client.js, line 46

##### Returns:

a reference to this, so the API can be used fluently

Type
  DnsClient

#### lookup4(name, handler) → {DnsClient}

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

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | the name to resolve
`handler` | function | the to notify with the AsyncResult. The handler will get notified with the resolved Inet4Address if a record was found. If non was found it will get notifed with `null`. If an error accours it will get failed.

Source:
  - vertx-js/dns_client.js, line 68

##### Returns:

a reference to this, so the API can be used fluently

Type
  DnsClient

#### lookup6(name, handler) → {DnsClient}

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

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | the name to resolve
`handler` | function | the to notify with the . The handler will get notified with the resolved Inet6Address if a record was found. If non was found it will get notifed with `null`. If an error accours it will get failed.

Source:
  - vertx-js/dns_client.js, line 90

##### Returns:

a reference to this, so the API can be used fluently

Type
  DnsClient

#### resolveA(name, handler) → {DnsClient}

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

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | the name to resolve
`handler` | function | the Handler to notify with the AsyncResult. The handler will get notified with a List that contains all the resolved Inet4Addresses. If none was found an empty List will be used. If an error accours it will get failed.

Source:
  - vertx-js/dns_client.js, line 112

##### Returns:

a reference to this, so the API can be used fluently

Type
  DnsClient

#### resolveAAAA(name, handler) → {DnsClient}

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

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | the name to resolve
`handler` | function | the Handler to notify with the AsyncResult. The handler will get notified with a List that contains all the resolved Inet6Addresses. If none was found an empty List will be used. If an error accours it will get failed.

Source:
  - vertx-js/dns_client.js, line 134

##### Returns:

a reference to this, so the API can be used fluently

Type
  DnsClient

#### resolveCNAME(name, handler) → {DnsClient}

Try to resolve the CNAME record for the given name.

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | the name to resolve the CNAME for
`handler` | function | the to notify with the . The handler will get notified with the resolved String if a record was found. If none was found it will get notified with `null`. If an error accours it will get failed.

Source:
  - vertx-js/dns_client.js, line 156

##### Returns:

a reference to this, so the API can be used fluently.

Type
  DnsClient

#### resolveMX(name, handler) → {DnsClient}

Try to resolve the MX records for the given name.

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | the name for which the MX records should be resolved
`handler` | function | the Handler to notify with the 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 List. If an error accours it will get failed.

Source:
  - vertx-js/dns_client.js, line 178

##### Returns:

a reference to this, so the API can be used fluently.

Type
  DnsClient

#### resolveNS(name, handler) → {DnsClient}

Try to resolve the NS records for the given name.

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | the name for which the NS records should be resolved
`handler` | function | the to notify with the . The handler will get notified with a List that contains all resolved Strings. If none was found it will get notified with an empty List. If an error accours it will get failed.

Source:
  - vertx-js/dns_client.js, line 244

##### Returns:

a reference to this, so the API can be used fluently.

Type
  DnsClient

#### resolvePTR(name, handler) → {DnsClient}

Try to resolve the PTR record for the given name.

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | the name to resolve the PTR for
`handler` | function | the to notify with the . The handler will get notified with the resolved String if a record was found. If none was found it will get notified with `null`. If an error accours it will get failed.

Source:
  - vertx-js/dns_client.js, line 222

##### Returns:

a reference to this, so the API can be used fluently.

Type
  DnsClient

#### resolveSRV(name, handler) → {DnsClient}

Try to resolve the SRV records for the given name.

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | the name for which the SRV records should be resolved
`handler` | function | 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 List. If an error accours it will get failed.

Source:
  - vertx-js/dns_client.js, line 266

##### Returns:

a reference to this, so the API can be used fluently.

Type
  DnsClient

#### resolveTXT(name, handler) → {DnsClient}

Try to resolve the TXT records for the given name.

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` | string | the name for which the TXT records should be resolved
`handler` | function | the to notify with the . The handler will get notified with a List that contains all resolved Strings. If none was found it will get notified with an empty List. If an error accours it will get failed.

Source:
  - vertx-js/dns_client.js, line 200

##### Returns:

a reference to this, so the API can be used fluently.

Type
  DnsClient

#### reverseLookup(ipaddress, handler) → {DnsClient}

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.

##### Parameters:

Name | Type | Description
--- | --- | ---
`ipaddress` | string | the IP address to resolve the PTR for
`handler` | function | the to notify with the . The handler will get notified with the resolved String if a record was found. If none was found it will get notified with `null`. If an error accours it will get failed.

Source:
  - vertx-js/dns_client.js, line 289

##### Returns:

a reference to this, so the API can be used fluently.

Type
  DnsClient