🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

dns-over-https

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dns-over-https

Resolve DNS records via the Google Public DNS HTTPS API

0.1.0
latest
Source
npm
Version published
Maintainers
1
Created
Source

dns-over-https

Build Status npm version Download Total

Resolve DNS records via the Google Public DNS HTTPS API

Google Public DNS docs

Installation

yarn add dns-over-https

Usage

import resolveRecord from 'dns-over-https';
import caw from 'caw';

(async () => {
  const a = await resolveRecord('google.com'); // resolves for A records

  const aaaa = await resolveRecord('google.com', 'AAAA'); // resolves for AAAA records

  const txt = await resolveRecord('google.com', 'TXT', {
    disableDNSSEC: true,
    EDNSClientSubnet: '0.0.0.0/0',

    // allows you to pass additional request headers
    headers: {
      'user-agent': 'custom'
    },

    // allows you to pass additional request options
    requestOptions: {
      agent: caw({ protocol: 'https' }) // enables proxy support
    }
  });
})();

Keywords

dns

FAQs

Package last updated on 09 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts