1.0.9 • Published 1 year ago

dnspacket-ts v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

DNS Packet

Node/Browser module for encoding and decoding DNS packet based on rfc 1035

Usage

import { decode, encode } from "dnspacket-ts";
import axios from 'axios';

const query: DNSQuery = {
  id: 153,
  flags: {
    RD: 1,
  },
  questions: [
    { CLASS: "IN", NAME: "google.com", TYPE: "AAAA" },
  ],
};

const data = encode(query);

(async () => {
  const rdr = await axios({
    url: 'https://cloudflare-dns.com/dns-query',
    method: 'POST',
    data,
    headers: { 'Content-Type': 'application/dns-message' },
    responseType: 'arraybuffer'
  });

  console.log(decode(rdr.data));
})();

Ressouces

1.0.9

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago