# Class: DnsClient

## jala.DnsClient(nameServer)

This is a wrapper around the Dns Client by wonderly.org providing methods for querying Dns servers. For more information about the Java DNS client visit https://javadns.dev.java.net/. Please mind that the nameserver specified must accept queries on port 53 TCP (the Java DNS client used doesn't support UDP nameserver queries), and that reverse lookups are not supported.

## Constructor

#### new DnsClient(nameServer)

Constructs a new DnsClient object.

##### Parameters:

Name | Type | Description
--- | --- | ---
`nameServer` | String | IP-Address or FQDN of nameserver to query

Source:
  - jala/code/DnsClient.js, line 54

### Classes

Record

### Members

#### nameServer :String

Contains the IP Adress/FQDN of the name server to query.

##### Type:

- String

Source:
  - jala/code/DnsClient.js, line 59

#### (static, readonly) TYPE_A :Number

The "A" record/query type.

##### Type:

- Number

Source:
  - jala/code/DnsClient.js, line 86

#### (static, readonly) TYPE_CNAME :Number

The "CNAME" record/query type.

##### Type:

- Number

Source:
  - jala/code/DnsClient.js, line 93

#### (static, readonly) TYPE_MX :Number

The "MX" record/query type.

##### Type:

- Number

Source:
  - jala/code/DnsClient.js, line 100

#### (static, readonly) TYPE_NS :Number

The "NS" record/query type.

##### Type:

- Number

Source:
  - jala/code/DnsClient.js, line 107

#### (static, readonly) TYPE_PTR :Number

The "PTR" record/query type.

##### Type:

- Number

Source:
  - jala/code/DnsClient.js, line 114

#### (static, readonly) TYPE_SOA :Number

The "SOA" record/query type.

##### Type:

- Number

Source:
  - jala/code/DnsClient.js, line 121

#### (static, readonly) TYPE_TXT :Number

The "TXT" record/query type.

##### Type:

- Number

Source:
  - jala/code/DnsClient.js, line 128

#### (static, readonly) TYPE_WKS :Number

The "WKS" record/query type.

##### Type:

- Number

Source:
  - jala/code/DnsClient.js, line 135

### Methods

#### query(dName, queryType)

Queries the nameserver for a specific domain and the given type of record.

##### Parameters:

Name | Type | Description
--- | --- | ---
`dName` | String | The domain name to query for
`queryType` | Number | The type of records to retrieve

Source:
  - jala/code/DnsClient.js, line 145

##### Returns:

The records retrieved from the nameserver

#### queryMailHost(dName)

Convenience method to query for the MX-records of the domain passed as argument.

##### Parameters:

Name | Type | Description
--- | --- | ---
`dName` | String | The domain name to query for

Source:
  - jala/code/DnsClient.js, line 176

##### Returns:

The records retrieved from the nameserver