Skip to content

Commit

Permalink
Updated - catch err for ANY query, readme texts
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiIgna committed Jan 13, 2020
1 parent f530aaa commit bcb9adb
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 14 deletions.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 🌍 DNS Records

**dns-records** is a DNS helper tool for Node.js than can quickly retrieve or discover DNS records for a domain.
**dns-records** is a DNS helper tool for Node.js than can quickly discover and retrieve DNS records for a domain.

Uses `dig` command to make DNS requests, has a built-in list of subdomains to test for and has support for auto-discovering subdomains based on records found.
Uses `dig` command to make DNS requests, has a built-in list of subdomains to test for and has support for auto-discovering more subdomains based on records found.

## Highlights
* Retrieves really fast DNS records for a domain
Expand All @@ -17,6 +17,11 @@ Aiming to have these features:

## Getting Started

#### Requirements

- `dig` command for DNS lookups
- `time` command to measure response times

#### Installation

```npm i @layered/dns-records```
Expand Down Expand Up @@ -117,16 +122,16 @@ Returns a promise which resolves with an `Array` of NS info:
soaSerial: '1565080527',
IPv4: [ '69.171.239.12' ],
IPv6: [ '2a03:2880:fffe:c:face:b00c::35' ],
responseTimev4: '',
responseTimev6: ''
responseTimev4: [ 53 ],
responseTimev6: [ 75 ]
},
{
ns: 'b.ns.facebook.com.',
soaSerial: '1565080527',
IPv4: [ '69.171.255.12' ],
IPv6: [ '2a03:2880:ffff:c:face:b00c::35' ],
responseTimev4: '',
responseTimev6: ''
responseTimev4: [ 57 ],
responseTimev6: [ 83 ]
}
]
```
Expand Down
10 changes: 8 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,14 @@ const getAllRecords = async domain => {

// attempt to get ANY DNS records
if (!records.length) {
records = await getDnsRecords(domain, 'ANY', nameServers[0].value)
records = records.filter(record => record.type !== 'HINFO')

try {
records = await getDnsRecords(domain, 'ANY', nameServers[0].value)
records = records.filter(record => record.type !== 'HINFO')
} catch (err) {
// ANY query failed, carry on with other checks
console.warn(err.message)
}

// if no ANY records, request basic record types
if (!records.length) {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@layered/dns-records",
"version": "1.3.1",
"version": "1.3.2",
"description": "Discover publicly available DNS Records for a domain",
"keywords": [
"dns",
Expand All @@ -15,15 +15,15 @@
"bugs": {
"url": "https://github.com/LayeredStudio/dns-records/issues"
},
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/LayeredStudio/dns-records.git"
},
"homepage": "https://github.com/LayeredStudio/dns-records#readme",
"main": "index.js",
"scripts": {
"test": "mocha -t 25000 -s 5000"
},
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/LayeredStudio/dns-records.git"
},
"dependencies": {
"punycode": "^2.1.1"
},
Expand Down

0 comments on commit bcb9adb

Please sign in to comment.