How to check DNS propagation on Linux

While DNS introduces human-readable naming schemes for Internet hosts, it also brings with it extra overhead associated with resolving names to IP addresses. For end users, this overhead means additional DNS lookup latency for accessing any Internet host. For service providers, this implies the performance-critical DNS infrastructure that needs to be maintained. Minimizing these overheads has led to the extensive use of "caching" throughout DNS hierarchy. For example, there are web browser/OS's built-in DNS cache; DNS caching server of the local network; and the cache of local DNS servers operated by service providers, etc.

Such a deep chain of DNS caches has implication when it comes to "updating" DNS records. Oftentimes, when you update the DNS record of your host, the update is not immediately visible to the world. Instead, an old DNS record can temporarily be served from various DNS caches. Local DNS servers typically keep each DNS entry in their cache for up to a certain length of time, known as "time-to-live" (TTL), which can range from minutes to a day. Thus a typical DNS propagation delay (i.e., time taken to see any DNS update to propagate globally) is 24-48 hours.

If you would like to check how your DNS record propagates on the Internet, there are various online DNS lookup services you can try. Besides such third-party online services, there is a way to monitor DNS propagation natively on Linux.

Enter dnsyo.

dnsyo is a command line tool which performs DNS lookup of your domain name from various vantage points on the Internet. As of writing, dnsyo can query more than 1,800 open DNS resolvers belonging to 1,500 networks located in 33 countries worldwide. By comparing DNS lookup results from these servers, you can check if and how DNS has propagated on the Internet.

Install dnsyo on Linux

To install dnsyo on Ubuntu, Debian or Linux Mint:

$ sudo apt-get install python-pip
$ sudo pip install dnsyo --upgrade

To install dnsyo on CentOS, Fedora or RHEL:

$ sudo yum install python-pip
$ sudo pip install dnsyo --upgrade

Keep Track of DNS Propagation with dnsyo

By default, dnsyo randomly chooses 500 DNS servers (out of 1,800 or so servers), and performs DNS lookup from them. Periodically, dnsyo automatically downloads and updates a list of available DNS servers.

To check DNS lookup results of a domain name:

$ dnsyo xmodulo.com

If you moved your domain name from one IP address to another, and the DNS record has not fully propagated globally, you may see the domain resolved to either IP addresses, depending on which DNS servers are used. In the above example, all responding DNS servers report the same IP address.

Note that many high-traffic websites employ DNS-based load balancing, where domain name is deliberately resolved to a pool of IP addresses. In such cases, a domain name will always be resolved to multiple IP addresses. Check Twitter.com with dnsyo for example:

To get more detailed info of the DNS query (e.g., IP address/location of each DNS server), use "--extended" option.

$ dnsyo --extended xmodulo.com

Using dnsyo, you can also query a specific DNS record type. For example, to find the MX records of Google.com:

$ dnsyo google.com MX

Here is the complete command-line usage of dnsyo.

usage: dnsyo [options] domain [type]

Query lots of DNS servers and colate the results

positional arguments:
  domain                Domain to query
  type                  Record type (A, CNAME, MX, etc.)

optional arguments:
  -h, --help            show this help message and exit
  --resolvlist RESOLVLIST, -l RESOLVLIST
                        Location of the yaml resolvers list to download
                        (http/https)
  --verbose, -v         Extended debug info
  --simple, -s          Simple output mode (good for UNIX parsing)
  --extended, -x        Extended output mode including server addresses
  --threads THREADS, -t THREADS
                        Number of worker threads to use
  --servers SERVERS, -q SERVERS
                        Maximum number of servers to query (or ALL)
  --country COUNTRY, -c COUNTRY
                        Query servers by two letter country code

Subscribe to Xmodulo

Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.

5 thoughts on “How to check DNS propagation on Linux

  1. Interesting. it is handful for changes to multiple DNS records .... but for small business you can also use DNS lookup utilities such as dig and nslookup (for windows) and clear the DNS cache. it works fine with immediate effect.

  2. # dnsyo xmodulo.com
    Traceback (most recent call last):
    File "/usr/bin/dnsyo", line 5, in
    from pkg_resources import load_entry_point
    File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2655, in
    working_set.require(__requires__)
    File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 648, in require
    needed = self.resolve(parse_requirements(requirements))
    File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 546, in resolve
    raise DistributionNotFound(req)
    pkg_resources.DistributionNotFound: requests>=2.0.0,<2.1.0

    I got above messages. What to do right now? Please suggest me.

Leave a comment

Your email address will not be published. Required fields are marked *

Current day month ye@r *