When your domain is not resolving correctly, two of the most useful tools for diagnosing DNS issues are dig (on Linux/macOS) and nslookup (on Windows). These tools let you query DNS servers directly to see how your domain is configured.
Why Use These Tools?
-
Verify if your domain points to the correct IP address.
-
Check if DNS propagation is complete.
-
Inspect specific DNS records (A, MX, CNAME, TXT, etc.).
-
Identify misconfigurations between your registrar and hosting provider.
Using Web-Based DNS Tools
If you’re not comfortable with the command line, you can use free online tools:
-
whatsmydns.net → Check global DNS propagation.
-
digwebinterface.com → Run
digqueries online.
Using nslookup on Windows
-
Open Command Prompt.
-
Run a basic query:
Bash nslookup example.com→ Shows the IP address (A record) for the domain.
-
Query a specific DNS server→
Bash nslookup example.com 8.8.8.8
Uses Google DNS (8.8.8.8) instead of your default resolver. -
Look up MX (mail) records:
Bash nslookup set type=MX example.com
Using dig on Linux/macOS
-
Open Terminal.
-
Run a basic query:
Bash dig example.com→ Displays the A record for the domain.
-
Query a specific DNS server:
Bash dig @8.8.8.8 example.com -
Look up MX records:
Bash dig example.com MX -
Look up TXT records (useful for SPF/DKIM):
Bash dig example.com TXT
Interpreting Results
-
ANSWER SECTION → Shows the record returned (e.g., IP address for A record).
-
AUTHORITY SECTION → Shows which nameservers are authoritative for the domain.
-
ADDITIONAL SECTION → May include related records (like IPs of nameservers).