1.0.4 • Published 5 years ago

axios-with-dns v1.0.4

Weekly downloads
36
License
MIT
Repository
github
Last release
5 years ago

axios-with-dns

Allows you to query axios with a different/custom DNS server.

Usage

Allows you to pass in a "dnsServer" object into the axios config. It will run URLs against that dns server. You do this by passing an axios instance into the export function. This obviously requires Axios as a peer dependency. This is done by adding an interceptor to Axios.

This works in node.js.

const withDNS = require('axios-with-dns');
const axios = require('axios');

withDNS(axios);

(async () => {
  console.log(
    (await axios.get('https://www.google.com', { dnsServer: '8.8.8.8' })).config
      .url
  );
})();

Why?

I was working in a hybrid cloud on AWS and was annoyed by Route53's pricing model, so I created this package to allow for my application to run some queries against an internal DNS server.

Credits

This issue in the Axios repo

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago