DNS propagation is the process of updating DNS records across various DNS servers globally. Determining when DNS propagation is complete can depend on various factors like:
- TTL Values: TTL is a crucial factor. When you make changes to your DNS records, the new information is propagated across DNS servers as per the TTL value. If your TTL is set to 1 hour, for example, it might take up to an hour for changes to fully propagate.
- Wait for Double TTL: To ensure that most DNS caches have cleared the old information and picked up the new information, it’s often recommended to wait for at least double the TTL of the DNS record you’ve modified. If your TTL is set to 3600 seconds (1 hour), waiting for 2 hours is a reasonable guideline.
- Check Authoritative DNS Servers: Initially, check the authoritative DNS servers for your domain. These are the servers where you made the changes. If the changes are visible there, it’s an indication that the update process has started.
- Check Different DNS Servers: Use tools like
dig
,nslookup
, or online DNS checking tools to query DNS servers worldwide, including popular public DNS servers like Google’s (8.8.8.8) or Cloudflare’s (1.1.1.1). If you consistently see the updated information across different servers, it’s a positive sign.
- Use Online DNS Propagation Checkers: Various online tools are available that claim to check DNS propagation status. These tools query DNS servers located in different geographic regions to provide an overview of how widely your DNS changes have propagated.
In this guide, here is how we can use the terminal to check for the DNS propagation statuses Linux:
Install dnsutils on Linux
In Linux, dnsutils
refers to a package that includes a collection of utilities related to DNS (Domain Name System). This package provides command-line tools that allow users to query DNS servers, retrieve DNS information, and troubleshoot DNS-related issues. The most common utilities included in the dnsutils
package are dig
, nslookup
, host
, nsupdate
, and dnssec-*
tools.
To install dnsutils
on Linux, run the following command:
sudo apt-get update
sudo apt-get install dnsutils
After making changes to your DNS records, you can use these tools to query authoritative DNS servers directly or use online DNS propagation checking services. Keep in mind that DNS propagation may take some time, and different DNS servers across the globe may update at different rates.
Use dig
to query the DNS records
Replace “example.com” with your actual domain name.
dig example.com
This command will display the DNS information for your domain. Look for the “ANSWER SECTION” to see the current DNS records.
; <<>> DiG 9.16.1-Ubuntu <<>> example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: XXXXX
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: XXXX
;; QUESTION SECTION:
;example.com. IN A
;; ANSWER SECTION:
example.com. XXXXX IN A XXX.XXX.XXX.XXX
;; Query time: XX msec
;; SERVER: XXX.XXX.XXX.XXX#53(XXX.XXX.XXX.XXX)
;; WHEN: Day Mon DD HH:MM:SS UTC YYYY
;; MSG SIZE rcvd: XX
This output provides information about the DNS query, the answer section (containing the requested information, such as the IP address), query time, the DNS server used, and additional details.
Check specific DNS record types
If you want to check specific DNS record types, you can specify them in the query. For example, to check the A record:
dig A example.com
Replace “A” with the desired record type.
This specific query requests the IPv4 address (A record) associated with the domain “example.com.”
; <<>> DiG 9.16.1-Ubuntu <<>> A example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: XXXXX
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: XXXX
;; QUESTION SECTION:
;example.com. IN A
;; ANSWER SECTION:
example.com. XXXXX IN A XXX.XXX.XXX.XXX
;; Query time: XX msec
;; SERVER: XXX.XXX.XXX.XXX#53(XXX.XXX.XXX.XXX)
;; WHEN: Day Mon DD HH:MM:SS UTC YYYY
;; MSG SIZE rcvd: XX
Check against a specific DNS server
You can also check against a specific DNS server to see if it has updated. Replace “8.8.8.8” with the IP address of the DNS server you want to query.
dig example.com @8.8.8.8
This command will produce an output that’s similar to the following:
; <<>> DiG 9.16.1-Ubuntu <<>> example.com @8.8.8.8
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: XXXXX
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: XXXX
;; QUESTION SECTION:
;example.com. IN A
;; ANSWER SECTION:
example.com. XXXXX IN A XXX.XXX.XXX.XXX
;; Query time: XX msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Day Mon DD HH:MM:SS UTC YYYY
;; MSG SIZE rcvd: XX
Check multiple DNS servers
To check the DNS propagation across different DNS servers, you can use multiple queries against different servers.
dig example.com @8.8.8.8
dig example.com @1.1.1.1
dig example.com @your_custom_dns_server
This way, you can compare the results from different servers.
Check using nslookup
or host
Alternatively, you can use nslookup
or host
to check for the DNS propagation status
nslookup example.com
RECOMMENDED READING: How to use nslookup to check for DNS records
or
host example.com
Here’s a sample output for the above command
example.com has address XXX.XXX.XXX.XXX
example.com mail is handled by 10 mail.example.com.
In this output:
- The first line provides the IPv4 address (A record) associated with “example.com.”
- The second line indicates mail exchange (MX) information, showing that mail for “example.com” is handled by the mail server at “mail.example.com” with a priority of 10.\
The actual IP address and mail server information will vary based on the current DNS configuration for the “example.com” domain.
It’s important to note that DNS propagation is not an instantaneous process. It’s influenced by the TTL settings, the specific DNS server’s update frequency, and the policies of intermediate caching servers. While significant changes are often visible within a few hours, complete propagation might take up to 48 hours or more in some cases.