Looking up DNS yourself with nslookup, dig and online tools
Want to know what your domain's DNS really says? For example, whether a new record is already visible, where your mail comes in or which nameservers your domain uses? You can look that up yourself: online, or on your own computer with nslookup or dig. This article covers the most useful lookups and how to read the answer. Always replace yourdomain.com with your own domain.
The easiest way: online
- Domain health: shows in a few seconds whether your domain points to the right server, with an explanation for each part. If your domain is with us, you'll find the same check on the domain page in My WebOké, with fix buttons.
- Email check: whether MX, SPF, DKIM and DMARC are set up correctly.
- dnschecker.org: what DNS servers in different countries answer. Handy after a change.
- internet.nl and DNSViz: modern standards and DNSSEC.
Want to learn which online tools are available and how to read their results? That's covered in the lesson Online DNS tools of the free DNS course.
On your own computer
On Windows, use nslookup in the Command Prompt (search for cmd). On a Mac and on Linux, use dig in Terminal; nslookup works there too.
| What do you want to know? | Windows | Mac and Linux |
|---|---|---|
| Which IP address does my website point to? | nslookup yourdomain.com | dig +short A yourdomain.com |
| Where does my mail come in? | nslookup -type=mx yourdomain.com | dig +short MX yourdomain.com |
| Which TXT records are there (SPF, verification)? | nslookup -type=txt yourdomain.com | dig +short TXT yourdomain.com |
| Is my DMARC record in place? | nslookup -type=txt _dmarc.yourdomain.com | dig +short TXT _dmarc.yourdomain.com |
| Which nameservers does my domain use? | nslookup -type=ns yourdomain.com | dig +short NS yourdomain.com |
| Where does a CNAME point to? | nslookup -type=cname www.yourdomain.com | dig +short CNAME www.yourdomain.com |
Asking the nameserver directly
Normally you get the answer from your internet provider's DNS server, and it may still remember an old answer. If you ask your domain's nameserver directly, you'll see right away what's there now. At WebOké, those are ns1.webawere.nl, ns2.webawere.nl and ns3.webawere.com:
- Windows:
nslookup -type=mx yourdomain.com ns1.webawere.nl - Mac and Linux:
dig MX yourdomain.com @ns1.webawere.nl
Does the nameserver show the new value, but you still see the old one at home? Then your change is fine and you just need to wait until the old caching time has passed. Read How long does a nameserver or DNS change take?
Reading the answer
- A value, such as an IP address or
10 linux2023.webawere.nl.: the record exists. For MX, the priority comes first; the lowest number is used first. - A number after the name (without
+short), such as3600: the TTL, how long in seconds other computers may remember the answer. - Nothing, or No answer: the name does exist, but there's no record of this type.
- NXDOMAIN or Non-existent domain: the name doesn't exist at all. Check whether you typed it correctly, whether the domain is active and whether the nameservers are correct.
- SERVFAIL or Server failed: the DNS server couldn't give a proper answer. This often means DNSSEC is broken, for example after a transfer. Read DNSSEC and transferring: turn it off first, or bring the key along.
- A name with your domain name added twice at the end, such as
shops.example.com.yourdomain.com: a dot is missing at the end of a CNAME or MX record. See CNAME records and the trailing dot.
For advanced users
dig +trace yourdomain.comfollows the entire path, from the root via the registry to your own nameservers. This shows you which nameservers the registry actually passes on.dig -x 192.0.2.10ornslookup 192.0.2.10gives the reverse DNS (PTR) of an IP address.dig +dnssec yourdomain.comshows the DNSSEC signatures. Ifadappears in the flags line, your DNS server has validated the signature.
Want to practise this? In the lesson Looking up DNS with dig and nslookup of the free DNS course, you'll do it step by step, with exercises on your own practice domain.
Changing records yourself? Then read Managing DNS records in My WebOké.
