How to test DNS propagation using dig and host

July 25, 2025 / Domain and DNS

When you make changes to a DNS record (A, CNAME, MX, etc.), it may take some time for all caching DNS servers to reflect the updated record. To check if each name server has the new record, you can manually query them using the dig and host commands. And, this is exactly what you are going to explore in this tutorial.

Prerequisites:

  • A UNIX-like shell (Linux, macOS, WSL, etc.)
  • dig (from the BIND tools) and/or host installed

Here’s how to test DNS propagation:

  1. Using dig
    1. Query the Default Resolver, using the following command:
      dig example.com A

      Look under the ANSWER SECTION for the current IP.
      Check the TTL column to see how long this record will remain cached.

    2. To test DNS propagation using public resolvers, specify the server in your query. For example:
      dig @8.8.8.8 example.com A

      Or Cloudflare’s:

      dig @1.1.1.1 example.com A
    3. Use +short for Clean Output
      dig @8.8.8.8 example.com A +short
    4. Trace the Full Lookup Path
      dig example.com A +trace

      This shows each step from the root servers down to your authoritative nameserver.

  2. Using host
    1. The following command uses your system’s default DNS resolver and returns the A record(s) by default.
      host example.com
    2. Query a Specific DNS Server and replace 8.8.8.8 with any resolver’s IP:
      host example.com 8.8.8.8
    3. Check Different Record Types, using:
      host -t MX example.com 1.1.1.1 # MX record from Cloudflare 
      host -t NS example.com 8.8.4.4 # NS record from Google
  3. Checking Propagation Step-by-Step:
    1. Pick a few public DNS servers for testing:
      • Google: 8.8.8.8, 8.8.4.4
      • Cloudflare: 1.1.1.1, 1.0.0.1
      • OpenDNS: 208.67.222.222, 208.67.220.220
    2. Run identical queries on each:
      dig @8.8.8.8 example.com A +short
      dig @1.1.1.1 example.com A +short
      host example.com 208.67.222.222
    3. Compare results:
      1.  If some servers return the new record and others return the old one, propagation is still in progress.
      2. Note the TTL values—a high TTL on the prior record will delay the update on that resolver.
  4. To automate multiple checks, you can loop through a list of DNS servers directly in your shell script.
    SERVERS=(8.8.8.8 8.8.4.4 1.1.1.1 1.0.0.1 208.67.222.222)
    for S in “${SERVERS[@]}”; do
      echo “=== Querying $S ===”
      dig @$S example.com A +short
    done
  5. Quick Troubleshooting Tips
    1. Flush DNS cache before testing:
      Linux: sudo systemd-resolve --flush-caches
      macOS: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
      nscd: sudo service nscd restart
    2. Simplify the dig output:
      dig example.com A +short +nocmd +nocomments +nostats
    3. Check the authoritative DNS server:
      dig @ns1.yourdnsprovider.com example.com A +short

With these commands and best practices, you can confidently track DNS updates as they ripple through the global resolver network. If you require additional help, get in touch with our support staff at your earliest.

Need a quick site preview? Learn How to enable Temporary URL in cPanel WHM

Spread the love