Guide on how to debug a dns problem.

•

•

It Is Always Dns, Except When It Is Not

I once spent an entire Saturday morning at a logistics startup trying to figure out why our new microservice couldn’t talk to the database, only to realize I’d been staring at a cached record for forty minutes. There is a specific kind of madness that sets in when your application code is perfect, your network is “up,” and yet everything is failing because of a single, invisible string of characters. Most tutorials on how to debug a dns problem will tell you to check your config files or look at your provider’s dashboard, but they rarely mention the psychological toll of questioning your own sanity while chasing a TTL that refuses to expire.

I’m not here to give you a theoretical lecture on the OSI model or sell you on a fancy observability platform. Instead, I want to walk through the actual, messy steps I use when things go sideways in production. I’ll show you the specific commands I run to bypass my own assumptions and how to differentiate between a genuine configuration error and a local resolver being stubbornly helpful. This is about practical, battle-tested methods to find the truth, so you can get back to your life instead of staring at a terminal at 2 a.m.

Table of Contents

Why Your Dig Tool for Dns Troubleshooting Failed You

Why Your Dig Tool for Dns Troubleshooting Failed You

I’ve spent more time than I care to admit staring at a terminal, convinced that the `dig` tool for dns troubleshooting was lying to me. You run the command, it returns the old IP address, and you immediately start questioning whether the entire global routing table has collapsed. But usually, the tool isn’t lying; it’s just telling you exactly what your local environment thinks is true. I once spent an entire afternoon debugging a deployment issue only to realize I was looking at a cached result from a local resolver that hadn’t been updated.

The trap is assuming that `dig` provides a window into the “real” internet. In reality, you are often just querying the specific nameserver your OS has decided to talk to. If you aren’t explicitly pointing your queries at an authoritative server—like `dig @8.8.8.8` or your provider’s specific nameservers—you’re just seeing a potentially stale snapshot. I’ve also learned the hard way that even if the records are correct at the source, a lingering dns propagation delay can make your local results look like a failure. Sometimes the fix isn’t a complex configuration change, but simply realizing your machine is still clinging to a ghost of the previous setup.

Finding the Ghost in the Dns Server Configuration Errors

Finding the Ghost in the Dns Server Configuration Errors.

The hardest part about troubleshooting domain name resolution isn’t usually the tools; it’s the assumption that the server you’re talking to is actually telling the truth. I once spent an entire afternoon chasing a phantom routing issue, only to realize the authoritative nameserver had a stale zone file that hadn’t synced across the cluster. When you encounter dns server configuration errors, the problem often hides in the gap between what you think is configured and what the edge is actually serving. It’s rarely a total blackout; it’s usually a subtle, inconsistent response that makes you feel like you’re losing your mind.

If you’re seeing intermittent failures, stop looking at your local machine and start looking at the source. I’ve learned the hard way that even if you check dns records online using a third-party web tool and they look perfect, your internal infrastructure might still be stuck in the past. You have to verify the glue records and the SOA serial numbers. If the serials don’t match across your primary and secondary nodes, you aren’t dealing with a network outage—you’re dealing with a desynchronized state that will haunt your logs until someone manually forces a zone transfer.

Five things I stopped assuming when DNS goes sideways

  • Stop trusting your local resolver. I used to run `nslookup` and think I was seeing the truth, only to realize my ISP’s cache was serving me a stale record from three hours ago. Always use `dig @8.8.8.8` or a specific authoritative nameserver to bypass the local noise and see what the world actually sees.
  • Watch the TTL like a hawk. Most of my production headaches come from updating a record and then wondering why the “fix” hasn’t propagated. If you’re planning a migration, drop your TTL to 60 seconds a day in advance. It’s a bit of extra work, but it beats sitting on a conference call for an hour waiting for a cache to expire.
  • Check the glue records. I once spent an entire afternoon chasing a non-existent domain because I forgot that the registrar’s nameservers didn’t actually match the ones I set in the zone file. If the glue is wrong, the chain is broken, and no amount of clever configuration will save you.
  • Don’t ignore the trailing dot. It’s a tiny, pedantic detail that trips up even experienced engineers. If you’re configuring a zone file and forget that FQDNs need that trailing dot, you’ll end up with a domain like `api.example.com.example.com`. It looks ridiculous in the logs, but it’s a classic “why is this failing” moment.
  • Verify the path, not just the destination. Sometimes the DNS record is perfectly fine, but a firewall or a security group is silently dropping UDP port 53 traffic. If `dig` is timing out instead of returning an error, stop looking at your records and start looking at your network ACLs.

The Lessons I Learned the Hard Way

Don’t trust your local cache; if you aren’t testing against a known-good upstream resolver, you’re just debugging your own machine’s outdated memory.

TTL is a lie until it’s proven; always verify the actual time-to-live on the record you’re seeing, because assuming a long propagation window is how you spend four hours chasing a ghost.

Configuration errors are often silent; a server that responds isn’t necessarily a server that’s working correctly, so verify the specific record type, not just the connectivity.

The Post-Mortem Mindset

Debugging DNS with The Post-Mortem Mindset.

At the end of the day, debugging DNS isn’t about mastering a single command-line tool; it’s about realizing that your assumptions are usually the first thing that breaks. We’ve looked at why `dig` can lie to you when you ignore TTLs, and how a single misconfigured zone file can act like a ghost in the machine. If you can move past the habit of just checking if a record exists and start verifying the entire resolution path—from your local resolver all the way to the authoritative nameserver—you’ll stop chasing symptoms and start finding the actual root causes. It’s tedious, and it’s rarely as exciting as a new framework launch, but it’s the difference between a five-minute fix and a four-hour production outage.

I’ve spent enough nights on standby to know that these incidents feel personal while they’re happening. You feel like you should have known better. But the truth is, the network is a messy, layered abstraction that will always find a way to surprise you. Don’t let the frustration turn into a desire to just “patch it and move on.” Instead, treat every DNS headache as a documented lesson for your future self. Write down the weird edge case you found, even if it feels trivial now. One day, you’ll be the one getting the 2 a.m. page, and you’ll be glad you did the work to make the problem predictable instead of magical.

Frequently Asked Questions

How do I tell if the issue is actually my local resolver or if the upstream provider is just having a bad day?

The quickest way to stop guessing is to bypass your local stack entirely. If `dig` is failing, run it against a known-good public resolver like `1.1.1.1` or `8.8.8.8` using the `@` flag. If the public resolver gives you the right answer but your local one doesn’t, you’ve found your culprit—it’s likely your local cache or a misconfigured `/etc/resolv.conf`. If the public resolver also fails, then the upstream is indeed having a bad day.

When should I stop chasing TTL issues and just admit the record hasn't propagated yet?

If you’ve checked the authoritative nameservers and they’re returning the new record, but your local resolver is still spitting out the old one, stop. You’re just fighting a cache. If the change has been live for at least two TTL cycles and you’re still seeing discrepancies across different geographic regions, it’s not a “bug”—it’s just propagation. Close the terminal, go for a ride, and check it again in an hour. Chasing a single stale cache is a waste of a night.

Is there a way to verify if a specific DNSSEC signature is actually the reason my queries are being dropped?

If you suspect DNSSEC is the culprit, stop guessing and check the validation status directly. I usually use `dig +dnssec` to pull the RRSIG records, but the real test is checking the `AD` (Authenticated Data) flag in the response. If your resolver isn’t returning that bit, or if you see `SERVFAIL` when querying a known-good recursive resolver, your signatures are likely broken or the chain of trust is severed. Check the DS records upstream; that’s usually where the mismatch lives.

How do I debug DNS issues when I'm stuck behind a corporate proxy or a restrictive firewall that's hijacking my requests?

When you’re behind a corporate proxy, your local tools are lying to you. I’ve spent way too many hours debugging “DNS issues” that were actually just a middlebox intercepting port 53 and serving its own cached junk.

Tomasz Wierzbicki

About Tomasz Wierzbicki

I am not interested in arguing about frameworks. I am interested in why the thing broke at two in the morning and what would have prevented it. Most of what I know came from being wrong in production and writing it down afterwards.