Anik Sikder
Technical Writing/networking/dns-troubleshooting-guide
article.sh

$ open article

networking

DNS Troubleshooting Guide for Developers: Using dig, nslookup, host, and Real-World DNS Debugging Techniques

10 min readAugust 12, 2026
DNS Troubleshooting Guide Using dig, nslookup, and DNS Debugging Tools

Most DNS problems don't begin with DNS.

At least, that's what people initially believe.

A website becomes unavailable.

An SSL certificate suddenly stops working.

Email delivery fails.

A SaaS customer reports that their custom domain is broken.

Traffic disappears after a migration.

The application appears healthy.

The database is running.

The servers are responding.

Yet users still cannot access the system.

Eventually someone runs a DNS lookup and discovers the real problem.

DNS sits at the front door of almost every internet service.

Before a browser loads a webpage...

Before an API receives a request...

Before an email server accepts a message...

Before an AI crawler retrieves content...

DNS must work correctly.

This is why DNS troubleshooting remains one of the most valuable infrastructure skills developers can learn.

Throughout this DNS series, we've explored how DNS works, why DNS changes appear to "propagate," how managed DNS providers operate at global scale, and how modern SaaS platforms use DNS for custom domains and multi-tenant architectures.

Understanding DNS theory is important.

But eventually every engineer reaches a point where they need to answer a more practical question:

Why isn't this working?

That's where troubleshooting begins.

This article focuses on diagnosing real-world DNS problems.

We'll learn how to investigate DNS issues using tools such as:

  • dig
  • nslookup
  • host
  • whois

We'll also explore how experienced engineers troubleshoot:

  • Website outages
  • DNS propagation issues
  • Email delivery failures
  • Custom domain onboarding problems
  • SSL verification errors
  • Production infrastructure incidents

Because effective DNS troubleshooting isn't about memorizing commands.

It's about understanding how the system behaves, identifying where resolution breaks down, and systematically narrowing the possible causes until the real problem becomes obvious.


Why DNS Troubleshooting Matters

Imagine a user visits:

code
app.company.com

The browser cannot load the application.

The immediate assumption might be:

code
Application Failure

But the actual issue could be:

code
DNS Failure

The application may be perfectly healthy.

Users simply cannot find it.

This distinction matters.

Modern infrastructure depends on many layers:

code
DNS
 ↓
Network
 ↓
TLS
 ↓
Load Balancer
 ↓
Application
 ↓
Database

Troubleshooting becomes easier when you identify which layer is failing.

DNS is often the first place to investigate.


Understanding the DNS Troubleshooting Mindset

Many engineers begin with commands.

Experienced engineers begin with questions.

For example:

code
Can the domain resolve?
code
Is the answer correct?
code
Is the answer consistent globally?
code
Is caching involved?
code
Is the issue DNS or something else?

The goal is not simply collecting data.

The goal is narrowing possibilities.


The Most Important DNS Troubleshooting Tool: dig

If developers could learn only one DNS tool, it should probably be:

code
dig

The name stands for:

code
Domain Information Groper

Despite its age, dig remains the gold standard for DNS diagnostics.

Basic usage:

code
dig example.com

Output typically includes:

code
Question
Answer
Authority
Additional Records
Query Time

This provides far more information than most GUI DNS checkers.


Reading dig Output

Example:

code
dig example.com

May return:

code
example.com. 300 IN A 203.0.113.10

Breaking this down:

code
example.com

Domain queried.

code
300

TTL.

code
A

Record type.

code
203.0.113.10

Returned IP address.

Learning to read these components is fundamental to DNS debugging.


Querying Specific Record Types

One of the most common troubleshooting tasks involves checking individual record types.

Example:

A Records

code
dig example.com A

AAAA Records

code
dig example.com AAAA

MX Records

code
dig example.com MX

TXT Records

code
dig example.com TXT

NS Records

code
dig example.com NS

This targeted approach helps isolate specific configuration issues.


Using dig +short

Sometimes you only need the answer.

Example:

code
dig example.com +short

Output:

code
203.0.113.10

This is especially useful in scripts and quick diagnostics.


Understanding DNS Propagation with dig

One of the most common support tickets looks like:

I updated DNS but nothing changed.

As discussed in our DNS Propagation article, propagation is usually cache expiration rather than actual propagation.

To verify current answers:

code
dig example.com

Then compare results using different resolvers.

Example:

code
dig @1.1.1.1 example.com
code
dig @8.8.8.8 example.com
code
dig @9.9.9.9 example.com

If responses differ, caching may still be involved.


Tracing DNS Resolution

One of the most powerful dig features is:

code
dig +trace example.com

This shows the complete resolution path:

code
Root Servers
      ↓
TLD Servers
      ↓
Authoritative Servers
      ↓
Final Answer

This command is invaluable during complex troubleshooting.


Diagnosing Authoritative DNS Problems

Sometimes recursive resolvers aren't the issue.

The authoritative server is.

Check nameservers:

code
dig example.com NS

Example output:

code
ns1.provider.com
ns2.provider.com

Now query them directly:

code
dig @ns1.provider.com example.com

This helps identify whether the authoritative source itself is incorrect.


Using nslookup

Although dig is generally preferred, nslookup remains widely available.

Basic usage:

code
nslookup example.com

Output:

code
Name: example.com
Address: 203.0.113.10

Simple.

Readable.

Available on most operating systems.


When nslookup Is Useful

nslookup is particularly valuable when:

  • Working on Windows systems
  • Performing quick checks
  • Supporting non-technical teams

Many IT teams continue using it because of its simplicity.


Querying Different Record Types with nslookup

Example:

code
nslookup -type=MX example.com

Or:

code
nslookup -type=TXT example.com

This allows verification of:

  • Email records
  • Domain verification tokens
  • Security configurations

The host Command

Many Linux systems also include:

code
host

Example:

code
host example.com

Output:

code
example.com has address 203.0.113.10

Simple.

Fast.

Easy to remember.


Why host Is Useful

For quick investigations:

code
host example.com

often provides enough information without overwhelming output.

Many engineers keep it as their first lookup tool.


Troubleshooting Website Outages

Suppose users report:

code
Website Not Reachable

Start with:

code
dig example.com

Questions:

  1. Does DNS resolve?
  2. Is the IP correct?
  3. Has the record changed recently?
  4. Are multiple resolvers returning different answers?

Only after DNS is verified should you investigate application infrastructure.


Diagnosing Email Problems

Email issues frequently trace back to DNS.

Check MX records:

code
dig example.com MX

Example:

code
10 mail.example.com

If MX records are missing:

code
Email Delivery May Fail

Verifying SPF Records

Check:

code
dig example.com TXT

Example:

code
v=spf1 include:_spf.google.com ~all

Incorrect SPF configurations often cause deliverability issues.


Verifying DKIM Records

Example:

code
dig selector._domainkey.example.com TXT

Useful when troubleshooting:

  • Gmail delivery
  • Microsoft 365
  • Transactional email systems

Verifying DMARC Records

Example:

code
dig _dmarc.example.com TXT

Expected:

code
v=DMARC1; p=quarantine

These records play a major role in email trust and anti-spoofing protections.


Troubleshooting SaaS Custom Domains

As discussed in our SaaS DNS Architecture article, custom domains introduce additional complexity.

Common issue:

Customer reports:

code
portal.company.com
doesn't work

Start by verifying:

Ownership Records

code
dig TXT portal.company.com

CNAME Records

code
dig CNAME portal.company.com

SSL Validation Records

code
dig TXT _acme-challenge.portal.company.com

Most onboarding issues appear in one of these areas.


Understanding CNAME Problems

A common mistake:

code
CNAME
and
A Record

defined simultaneously.

DNS standards prohibit this.

Example:

code
app.example.com A 203.0.113.10
app.example.com CNAME platform.example.com

This creates conflicts.

Only one approach should be used.


Diagnosing DNSSEC Problems

DNSSEC adds security.

It can also introduce failures.

Example symptoms:

code
Domain Resolves For Some Users
Fails For Others

Potential causes:

  • Invalid signatures
  • Expired keys
  • Incorrect DS records

DNSSEC troubleshooting often requires examining authoritative configuration carefully.


Using whois

DNS troubleshooting sometimes begins before DNS.

Example:

code
whois example.com

Provides:

  • Registrar information
  • Registration dates
  • Expiration dates
  • Nameservers

This helps identify ownership and administrative issues.


Troubleshooting Expired Domains

A surprising number of outages occur because:

code
Domain Expired

The infrastructure remains healthy.

The application remains healthy.

The domain simply no longer exists.

Always check expiration status during incident investigations.


A Real-World DNS Troubleshooting Workflow

Experienced engineers often follow a process similar to:

code
Problem Reported
        ↓
DNS Resolution
        ↓
Record Verification
        ↓
Nameserver Verification
        ↓
Propagation Analysis
        ↓
TLS Verification
        ↓
Application Investigation

This systematic approach reduces guesswork.


Common DNS Mistakes

Repeatedly observed across organizations:

Wrong Nameservers

code
Domain points to incorrect provider

Missing Records

code
MX removed during migration

Incorrect TTL

code
Changes delayed unexpectedly

Broken Verification Records

code
TXT validation fails

Expired Domains

code
Renewal forgotten

Assuming Propagation

Many troubleshooting sessions begin with:

code
Maybe DNS propagation?

Often the real issue is simply a configuration error.


DNS Troubleshooting Checklist

When diagnosing DNS issues:

✓ Does the domain resolve?

✓ Are nameservers correct?

✓ Are records correct?

✓ Are TTL values reasonable?

✓ Do multiple resolvers agree?

✓ Is authoritative DNS correct?

✓ Are SSL validations succeeding?

✓ Are email records configured properly?

✓ Is caching involved?

✓ Has the domain expired?

This checklist resolves a surprising number of incidents.


Frequently Asked Questions

What is the best DNS troubleshooting tool?

For most engineers:

code
dig

remains the most powerful and flexible option.


What does dig do?

It queries DNS records and provides detailed diagnostic information.


Is dig better than nslookup?

Generally yes.

dig provides more visibility and troubleshooting capabilities.


How do I check DNS propagation?

Query multiple resolvers:

code
dig @1.1.1.1 example.com
dig @8.8.8.8 example.com

and compare results.


How do I verify MX records?

Use:

code
dig example.com MX

How do I troubleshoot custom domain issues?

Verify:

  • TXT records
  • CNAME records
  • SSL validation records
  • DNS ownership verification

Key Takeaways

  • DNS is often the first dependency in internet communications.
  • dig is the most valuable DNS troubleshooting tool for developers.
  • nslookup and host remain useful for quick diagnostics.
  • DNS troubleshooting requires understanding system behavior, not just commands.
  • Email delivery problems frequently originate in DNS configuration.
  • SaaS custom domains introduce additional DNS complexity.
  • DNS propagation issues are usually caching issues.
  • Systematic troubleshooting dramatically reduces incident resolution time.
  • Strong DNS knowledge improves infrastructure reliability and operational efficiency.

About the Author

Anik Sikder is a Software Engineer specializing in Backend Systems, Cloud Infrastructure, Networking, SaaS Architecture, Python, Django, FastAPI, and Distributed Systems.

He writes about networking, DNS, system design, cloud architecture, infrastructure engineering, and scalable software systems.

$ tags

dnsdns-troubleshootingdig-commandnslookupnetworkingdevopscloudinfrastructuresystem-designdebuggingsoftware-engineeringsaas

$ ls related_articles

status: end_of_file

Related Blueprints

Continue exploring related architecture patterns.

Multi-Tenant SaaS Architecture

Designing tenant-aware platforms with strong data isolation, scalability, and shared infrastructure efficiency.

01Schema-per-tenant isolation
02Tenant-aware request routing
03Shared infrastructure model
04Secure data segregation
05Subscription-driven tenancy

Cloud & Distributed Systems

Building event-driven services, background processing pipelines, and production-ready operational workflows.

01Event-driven architecture
02Async task processing
03Redis & caching
04Background workers
05Observability & monitoring

TalentFlow HCM (Human Capital Management Platform)

Enterprise-grade human capital management platform designed to unify employee lifecycle management, payroll operations, recruitment workflows, attendance tracking, performance management, and workforce analytics within a secure multi-tenant architecture.

01WebSocket-first real-time communication
02Versioned contracts and acceptance workflows
03Double-entry escrow and wallet ledger
04Atomic milestone state transitions
05Transactional outbox and idempotent events
06Dispute-driven fund freezing
07CQRS read models for messaging and transactions