Checking Domain TTL Values

4th January 2019

Part of the process of putting a new site live can be moving DNS entries around. Prior to doing this it's a really good idea to sort out the Time To Live (TTL) of the DNS record so that when you do change DNS entries you aren't waiting around for a day for the DNS to sort itself out. Most DNS registrars will allow you to set your TTL down to a minute or so.

It's also very important to check the status of your DNS records to ensure that they have the correct TTL, usually a day before (and day of) the move.

You can check the TTL value of your A record with the host command. Change the value of the -t (type) flag to aaaa or cname to inspect different types of records.

host -a -t a

This will produce the following output. The TTL of the domain below is '125'.

  1. Trying ""
  2. ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42916
  3. ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
  6. ; IN A
  9. 125 IN A
  10. 125 IN A
  12. Received 70 bytes from in 4 ms

It's also possible to check the same result with dig using the command.

dig +nocmd +noall +answer +ttlid

This produces the following result. The TTL value for the domain is '91'.

  1. 91 IN A
  2. 91 IN A

If you are worried that the response has been cached up stream (which is how DNS works and why you need to lower the TTL in the first palce) you can directly interrogate the DNS name server for a response. This is done using the whois command.


This will tell you a lot about the domain name. The important bit of information is called Name Server. Different TLD providers will produce different whois ouputs, but the information will be in there somewhere.

For my own site the name server entries looked like this.

  1. Name Server:
  2. Name Server:

With this information in hand you can directly interrogate the DNS server using the following.

dig +nocmd +noall +answer

This is perhaps the most reliable way to test your domain TTL values as it cuts out any caching of results.

Finally, always remember to check all domains and sub-domains you are migrating. This especially means checking the www and non-www variants of every address you are migrating.

Add new comment

The content of this field is kept private and will not be shown publicly.