edgeport - v1.0.6
    Preparing search index...

    Function query

    • Runs a raw DNS query in a single call and returns the full structured response.

      The level-3 tooling path: it never throws on an error rcode (the rcode is on the result), and it exposes the authority and additional sections. Opens and closes a connection around the one query.

      Parameters

      • raw: RawQuery

        The raw query (questions, flags, opcode, optional DNSSEC).

      • opts: DnsConnectOptions = {}

        Connection options (resolver host/port, TLS, timeout).

      Returns Promise<DnsResponse>

      The full structured response.

      If the resolver cannot be reached.

      If the response is malformed.

      If the query deadline elapses.

      1.0.4

      import { query, RESOLVERS } from 'edgeport/dns';

      const res = await query(
      { questions: [{ name: 'example.com', type: 'A' }], dnssec: true },
      { hostname: RESOLVERS.quad9 }
      );
      console.log(res.rcode, res.answers, res.authority);