DNS Lookup with nw
Build the nw command that asks DNS servers about a domain. Works with UDP, TCP, DoT, and DoH. Learn what NXDOMAIN and timeout errors mean.
DNS lookup test (test dns)
Asks one or more DNS servers about a domain and shows the answer. A server can use plain UDP or TCP, DoT (with tls://), or DoH (with https://).
How to read the result
- The status is success, failure, skipped, or inconclusive.
- The error code gives the cause. dns.nxdomain: the domain does not exist. dns.timeout: no answer came. dns.servfail and dns.refused: the server did not answer. dns.no_answer: the domain exists but has no record of this type.
- Add several servers and compare their answers.
Exit codes
0: all worked. 1: at least one failed. 2: wrong command.
Install nw
If you have Go, this one command is enough. It puts the file in $(go env GOPATH)/bin, usually ~/go/bin.
Other ways to install are on the nwrk.ir install page: ready-made builds for Linux, macOS, and Windows, and install scripts.
The install scripts download a script and run it. Read the script before you run it.
nwrk.ir install page (opens in a new tab)This page only builds the command. You run nw yourself, on your own device.
How to Use It
- Type the domain.
- To compare DNS servers, add each one on its own line.
- Copy the command. Run it in your terminal.
Questions and Answers
Why test several DNS servers?
If the answers differ, or one server does not answer, the problem is that server, not the domain.
What are DoT and DoH?
DoT (tls://) and DoH (https://) lock the DNS question so others cannot read it. nw supports both.
Good to Know
This page only builds the command. It runs no test. To run it, install nw on your own device. The commands come from the nwrk.ir docs for version 0.5.
Related Tools
- IP Subnet Calculator (CIDR)Work out the network, broadcast, mask, host range, and address count for IPv4 and IPv6, and see whether an address is private or reserved.
- Diagnose Why a Website Won't Load with nwBuild the nw diagnose command. It tests DNS, TCP, TLS, and HTTP one by one and shows the first step that fails, so you know where the problem is.
- nw Command BuilderBuild the exact nw command to test DNS, TCP, TLS, or HTTP, trace a path, or find why a connection fails. Learn how to read the result and the exit code.
Source code of this tool (opens in a new tab)Report a problem on GitHub (opens in a new tab)