DNS

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
NameTypeDescription
data.idnumberTransaction identifier.
data.qrnumberQuery/response flag (0 = query, 1 = response).
data.opcodenumber4-bit query opcode.
data.aanumberAuthoritative answer flag.
data.tcnumberTruncation flag.
data.rdnumberRecursion desired flag.
data.ranumberRecursion available flag.
data.rcodenumber4-bit response code.
data.qdCountnumberNumber of questions.
data.anCountnumberNumber of answers.
data.nsCountnumberNumber of authority records.
data.arCountnumberNumber of additional records.
Implements

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:
NameTypeAttributesDescription
optObject<optional>
Properties
NameTypeAttributesDefaultDescription
udpPayloadSizenumber<optional>
4096
extendedRcodenumber<optional>
0
versionnumber<optional>
0
doFlagnumber<optional>
0
optionsArray.<{code: number, data: (Buffer|Array)}><optional>
[]
Returns:
Type: 
Object