edgeport - v1.0.6
    Preparing search index...

    Function decodeMessage

    • Decodes a complete, already-framed DNS message (without the TCP length prefix).

      Reads the header, the question section, then the answer / authority / additional records, decoding the resource data of the understood TYPEs into structured fields while keeping the raw rdata on every record. Compression pointers in names (including inside rdata) are followed.

      Parameters

      • bytes: Uint8Array

        The bare DNS message bytes.

      Returns DnsMessage

      The decoded message.

      If the header is short or any field runs past the buffer.

      1.0.4

      import { decodeMessage } from 'edgeport/dns';

      const msg = decodeMessage(responseBytes);
      console.log(msg.answer[0]?.data);