DNS-over-HTTPS (DoH) client
const dohc = require('dohc');
let ip = await dohc('github.com');
To perform the request against a different DoH provider (default is
Cloudflare, as
specified in config.json
as DEFAULT_DOH_PROVIDER
):
let ip = await dohc('github.com', {
provider: 'dns.google/resolve'
});
To request a different DNS record type (default is A
, specified in
config.json
as DEFAULT_RECORD_TYPE
):
let ip = await dohc('github.com', {
type: 'AAAA'
});
To return the raw JSON response from the DoH provider:
let json = await dohc('github.com', {
raw: true
});
dohc github.com [--provider PROVIDER] [--type TYPE] [--raw]
This software is released under the terms of the MIT license. See LICENSE
.