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.
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 pip install dnsyo --upgrade
To install dnsyo on CentOS, Fedora or RHEL:
$ 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:
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.
Using dnsyo, you can also query a specific DNS record type. For example, to find the MX records of Google.com:
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.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!
Latest posts by Dan Nanni (see all)
- How to install Suricata intrusion detection system on Linux - September 3, 2015
- How to switch from NetworkManager to systemd-networkd on Linux - August 31, 2015
- How to set up a system status page of your infrastructure - August 25, 2015