new DNS()
DNS protocol layer (RFC 1035) - read-write with one important caveat: write-side name compression is not implemented in v1. Built buffers will therefore be longer than typical wireshark-captured frames, but parse-side compression (resolving 0xC0xx pointers) is fully supported. Supported RR types with structured rdata: A, AAAA, NS, CNAME, PTR, MX, TXT, SRV, OPT (EDNS0). Other types expose `rdata` as a raw Buffer.
Properties| Name | Type | Description |
|---|---|---|
data.id | number | Transaction identifier. |
data.qr | number | Query/response flag (0 = query, 1 = response). |
data.opcode | number | 4-bit query opcode. |
data.aa | number | Authoritative answer flag. |
data.tc | number | Truncation flag. |
data.rd | number | Recursion desired flag. |
data.ra | number | Recursion available flag. |
data.rcode | number | 4-bit response code. |
data.qdCount | number | Number of questions. |
data.anCount | number | Number of answers. |
data.nsCount | number | Number of authority records. |
data.arCount | number | Number of additional records. |
- Implements
- Source
Methods
(static) opt(optopt) → {Object}
Construct an EDNS0 OPT pseudo-RR suitable for placing in the `additional` section. All fields default to sensible values: 4096-byte UDP buffer, version 0, DO flag clear, no options.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opt | Object | <optional> | Properties
|
- Source
Returns:
- Type:
- Object