distributed-dig
Quick Start
- Install globally using
npm install -g distributed-dig
- Run
ddig [domain [domain] ...] [options]
Overview
Issues multiple DNS lookup requests across a multitude of DNS resolvers.
Useful for checking if a DNS record has been fully propagated, or for querying the origins behind an AWS Route 53 / Azure Traffic Manager record (or any other DNS-based load balancing solution).
Installation
Installing globally is recommended:
npm install -g distributed-dig
Usage
ddig domain [domain [domain] ...] [options]
Options
The following options are available:
--port <number> Specify the DNS port [53]
--protocol <upd|tcp> Specify the DNS protocol [udp]
--timeout <number> Specify the DNS timeout in milliseconds [2500]
--edns <true|false> Enable or disable EDNS(0) [false]
--list-resolvers List resolvers configured in config file
--list-options List DNS request options configured in config file
--verbose Outputs more information
--no-color Switches off colour output
--version Display version number
--help Display this help
help
Displays the help screen:
port
Specify the TCP/UDP port tro use when connecting to the DNS resolver.
Default: 53
protocol
Specify whether to use UDP or TCP when connecting to the DNS resolver.
Default: udp
timeout
Specifies the timeout in milliseconds to wait for a response from each DNS resolver.
Default: 2500
(2.5 seconds)
edns
Enables EDNS(0)
Default: false
(_disabled))
With EDNS(0) enabled, if an upstream resolver doesn't support it then the standard DNS will be used as a fallback.
Even though EDNS is support by ~90% of resolvers on the internet 1, it is disabled by default in ddig
as it may cause the resolver to return the IP address it considers closest to you, which is counterproductive to the purpose of querying many geographically distributed DNS resolvers.
list-resolvers
Lists the resolvers configured in the distributed-dig.json
config file:
list-options
Lists the options configured in the distributed-dig.json
config file:
verbose
Switches on verbose mode which outputs additional fields:
- Full recursive answer (i.e. nested
cname
records) - Resolver IP Address
- Response time
--verbose
also modifies the --list-resolvers
and --list-options
switches.
no-color
If your terminal has problems rendering the colour output then you can switch it off by using --no-color
version
Prints out distributed-dig's version number.
Examples
Lookup a single domain
- List the IP address returned for
www.asos.com
from each of the configured resolver:
ddig www.asos.com
Lookup a single domain with verbose enabled
- List the IP address and full recursive path returned for
www.asos.com
from each of the configured resolver:
ddig www.asos.com --verbose
Lookup multiple domains with an increased timeout
- List the IP addresses returned for
www.asos.com
, my.asos.com
& secure.asos.com
from each of the configured resolver with a 5 second timeout:
ddig www.asos.com my.asos.com secure.asos.com --timeout 5000
Features
Unique IP Address Identifier
The first occurrence of each unique IP address is marked by a bullet point:
Column Width Warning
If you use the --verbose
switch and have a terminal window that's narrower than 130 columns you'll see a warning:
Configuration File
All Options and Resolvers are configured in distributed-dig.json
file.
Request Options
The default options are:
"options": {
"request": {
"port": 53,
"type": "udp",
"timeout": 2500,
"try_edns": false,
"cache": false
},
"question": {
"type": "A"
}
}
DNS Resolvers
Resolvers are configured in an array with each resolver having a nameServer
element which should be the IPv4 or IPv6 address, and a provider
element which is just a freeform text label:
"resolvers": [
{
"nameServer": "208.67.222.222",
"provider": "OpenDNS (Primary)"
},
{
"nameServer": "208.67.220.220",
"provider": "OpenDNS (Secondary)"
},
{
"nameServer": "217.199.173.113",
"provider": "United Kingdom"
}
]
Debugging
distributed-dig
uses the npm package debug. If you set the environment variable debug
to ddig
you'll see full debug output.
Windows
set debug=ddig
Linux
DEBUG=ddig
Powershell
$env:debug="ddig"
FAQ
Question: What terminal/console are you using in the screen shots?
Answer: A pre-release of Microsoft's new tabbed Windows Terminal which has many excellent features, and the ability to configure a background image.