The global domain name system makes extensive use of caching. This means that changes you make won't always be reflected immediately.
DNS data can be cached at many levels and retrieved from various sources:
- in the browser
- by another application on your operating system
- at the operating system level...
- ... including manual configuration on your operating system
- a server on your local network
- your network router
- your service provider
- a DNS server you're using, that's sitting somewhere on the Internet
Every single one of these is capable of returning stale or incorrect data. Most of the time, all you need to do is wait a little longer for the data to be updated. However, this can be rather frustrating when you've made a change and want to see if it has worked!
Checking DNS values
Most operating systems provide command-line tools for checking DNS values. Favourites are nslookup, dig and host. For example:
➜ host aldryn.com
aldryn.com has address 18.104.22.168
aldryn.com has address 22.214.171.124
aldryn.com mail is handled by 1 aspmx.l.google.com.
aldryn.com mail is handled by 5 alt1.aspmx.l.google.com.
aldryn.com mail is handled by 5 alt2.aspmx.l.google.com.
aldryn.com mail is handled by 10 aspmx2.googlemail.com.
aldryn.com mail is handled by 10 aspmx3.googlemail.com.
This will tell you what data your operating system is reporting for that domain.
You can compare it with what other systems might be reporting by using an online lookup, such as Google's nslookup tool.
It's beyond the scope of this article to explain the intricacies of these tools, but there is plenty of information online.
Clearing DNS caches
Macintosh: see https://support.apple.com/en-gb/HT202516
Also, check that your /etc/hosts file does not contain any hardcoded IP addresses for your website:
- MS Windows: see http://www.technipages.com/flush-and-reset-the-dns-resolver-cache-using-ipconfig
- Linux: different Linux distributions use different methods of handling DNS caches, so you will need to look up the appropriate way of doing it on your own system.