DNS issues cause websites and email to be unavailable. Use dig and nslookup to diagnose: check A, MX, NS records, TTL, and DNS server responses.
Applies to:
✔ All services with domains
✔ Linux, macOS, Windows
dig example.com A
dig example.com MX
dig example.com NS
dig example.com TXT
Get only the value:
dig example.com A +short
nslookup example.com
nslookup -type=MX example.com
dig example.com A @8.8.8.8
Useful for comparing responses from different servers after a DNS change.
TTL shows how long DNS servers cache a record. In dig output, it's the second column:
example.com. 3600 IN A 1.2.3.4
3600 = 1 hour. Before a planned migration, reduce TTL in advance:
example.com. 300 IN A 1.2.3.4
| Status | Meaning |
| NOERROR, empty answer | Record doesn't exist for this type |
| NXDOMAIN | Domain doesn't exist (not delegated or not registered) |
| SERVFAIL | DNS server couldn't process the request |
| REFUSED | DNS server refused to serve the request |
dig example.com NS +short
dig example.com A @ns1.yourdns.net
dig example.com A @8.8.8.8
If the old IP is still returned, wait for TTL to expire.
dig example.com A +short
Should return the correct IP address of your server.
If DNS records are correct but the site doesn't work, the issue is on the web server side, not DNS. If NS servers don't respond (SERVFAIL), open a support ticket.