axios-with-dns

1.0.4 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i axios-with-dns

Weekly Downloads

2

Version

1.0.4

License

MIT

Unpacked Size

302 kB

Total Files

10

Last publish

Collaborators

  • rjerue