How to check DNS records and diagnose problems

12.03.2026
Complexity
min.

Summary

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

Basic commands

dig (Linux/macOS)

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 (Windows)

nslookup example.com
nslookup -type=MX example.com

Checking via a specific DNS server

dig example.com A @8.8.8.8

Useful for comparing responses from different servers after a DNS change.

TTL: record time to live

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

Common DNS errors

StatusMeaning
NOERROR, empty answerRecord doesn't exist for this type
NXDOMAINDomain doesn't exist (not delegated or not registered)
SERVFAILDNS server couldn't process the request
REFUSEDDNS server refused to serve the request

Diagnostics: site not loading after DNS change

  1. Check NS records:
    dig example.com NS +short
  2. Verify A record through those NS:
    dig example.com A @ns1.yourdns.net
  3. Check if public DNS cache updated:
    dig example.com A @8.8.8.8

If the old IP is still returned, wait for TTL to expire.

Verification

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.
Was this information helpful?
Yes   No
 
By continuing to use this website you will be agreeing to the website Acceptable Use Policy and the Use of Cookies while using the website and our services. Please also read our Privacy Policy under which, to the extent stated, you consent to the processing of your personal data.