edgeport - v1.0.6
    Preparing search index...

    Function decodeOpt

    • Decodes an OPT pseudo-record's full EDNS0 semantics from its header fields and rdata.

      The UDP payload size comes from the record's CLASS, the DO bit / version / extended RCODE from its TTL, and the options from its rdata.

      Parameters

      • rr: ResourceRecord

        An OPT resource record (type === RecordType.OPT).

      Returns OptData

      The decoded EDNS0 fields.

      If the record is not an OPT record.

      1.0.4

      import { decodeOpt, RecordType } from 'edgeport/dns';

      const opt = response.additional.find((rr) => rr.type === RecordType.OPT);
      if (opt) console.log(decodeOpt(opt).dnssecOk);