https://github.com/buschtoens/dns-over-https
Resolve DNS records via the Google Public DNS HTTPS API
https://github.com/buschtoens/dns-over-https
Last synced: 3 months ago
JSON representation
Resolve DNS records via the Google Public DNS HTTPS API
- Host: GitHub
- URL: https://github.com/buschtoens/dns-over-https
- Owner: buschtoens
- Created: 2018-01-08T14:21:00.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T08:39:24.000Z (almost 2 years ago)
- Last Synced: 2025-05-24T03:07:48.282Z (5 months ago)
- Language: JavaScript
- Size: 52.7 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dns-over-https
[](https://travis-ci.org/buschtoens/dns-over-https)
[](http://badge.fury.io/js/dns-over-https)
[](http://badge.fury.io/js/dns-over-https)Resolve DNS records via the [Google Public DNS HTTPS API](https://dns.google.com/query)
[Google Public DNS docs](https://developers.google.com/speed/public-dns/docs/dns-over-https)
## Installation
```
yarn add dns-over-https
```## Usage
```js
import resolveRecord from 'dns-over-https';(async () => {
const a = await resolveRecord('google.com'); // resolves for A recordsconst 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: {}
});
})();
```