HomeGuidesHow to Debug DNS Propagation, TTL & CNAME Flattening with dig and cURL
Networking & Domains6 min readUpdated 2026-11-06

How to Debug DNS Propagation, TTL & CNAME Flattening with dig and cURL

Troubleshoot domain routing, SPF/DKIM records, and Cloudflare CDN proxy configurations like a senior network engineer.

Need to do this immediately?

Use our free, private client-side browser tool with zero installation.

View DNS Records Cheat Sheet
"It is always DNS." When web applications experience sudden downtime or intermittent SSL certificate errors after a domain migration, misunderstanding DNS TTL caching and recursive resolvers is usually the culprit.

Querying Authoritative Nameservers Directly with dig

Testing DNS with standard ping or browser refreshes is misleading because your local operating system and ISP cache responses for hours.

Using `dig @1.1.1.1 example.com` queries Cloudflare's resolver, while `dig @ns1.domaincontrol.com example.com` queries the authoritative nameserver directly, bypassing all intermediate caches to inspect changes instantly.

Pro Tip:Lower your DNS TTL to 300 seconds (5 minutes) at least 24 hours BEFORE initiating a production server migration.

Bypassing DNS with cURL to Test Origin Servers

Before pointing live DNS to a new server, you must verify that the new server's NGINX or Caddy host is properly configured with valid SSL certificates.

Using cURL's `--resolve` flag (`curl --resolve example.com:443:104.19.192.175 https://example.com`) forces cURL to route directly to the new server IP without changing public DNS.

Step-by-Step Tutorial

1

Check Authoritative Nameserver Records

Run `dig +trace example.com` to observe the delegation tree from root servers down to your zone.

2

Verify Email SPF and DKIM Records

Run `dig TXT example.com` and `dig TXT <selector>._domainkey.example.com` to confirm syntax.

3

Test Live HTTPS Handshake with cURL

Run `curl -iv https://example.com` to inspect TLS certificate expiration dates and response headers.

Ready to Try It Yourself?

DocSwift processes everything directly on your device. Fast, safe, and completely free forever.

How helpful was this guide?

Rated 4.9 / 5 by 3,420+ users worldwide

Share with Colleagues & Friends

Help others protect their document privacy

Frequently Asked Questions

Why does DNS propagation take up to 48 hours?

While authoritative nameservers update within seconds, recursive ISP resolvers around the world honor the previous TTL (which may have been set to 86,400 seconds or 24 hours) before asking for new IP records.