Verifying propagation and caching issues when troubleshooting

Sometimes when setting up a website, a device can hold on to old information about the site, this can include things like the IP address the site should resolve to. When you add a site to Cloudflare and proxy it, your site’s public IP addresses will change to Cloudflare’s. If any old info is cached, it can mean that you see a broken or old version of your website and makes testing it difficult. Here is how you can verify if you have cached DNS values and some tips on what to do about it.

1. Testing for propagation issues
Firstly use a tool such as dnschecker.org, enter your domain and click ‘Search’, this will show you the public IPs seen in various testing points around the world (you can also choose the record type searched for, e.g. NS for nameserver propagation, however in this tutorial we will focus on the A and AAAA records). If there are different results from different checkpoints, it is most likely that your DNS is propagating around the world and you will need to wait to see the full results.

Choosing A will show the IPv4 addresses for the site, these will look something like 192.0.2.1
Choosing AAAA will show the IPv6 addresses for the site, these will look something like 2001:0db8:85a3:0000:0000:8a2e:0370:7334


2. Testing for local DNS caching issues and how to resolve them
You can check that your computer is seeing the same IP addresses as the rest of the world using the terminal or command line on your device. This will vary by operating system, however the most common are covered below.

Windows

Useful commands in Windows include ping and nslookup
(all screenshots are taken from Windows 10, other versions may differ but will be similar)

To open the terminal:
Click the start icon image
Type cmd and click to open the ‘Command Prompt’ image

The command
To see the DNS values your computer sees, we will use a command called nslookup. Enter this in your command line:
nslookup domain.tld replacing domain.tld with your domain name. Then press enter/return to run the command.
You will get a response that looks something like:

Server:  one.one.one.one
Address:  2606:4700:4700::1111

Non-authoritative answer:
Name:    domain.tld
Addresses:  2001:0db8:85a3:0000:0000:8a2e:0370:7334
          2001:0db8:85a3:0000:0000:8a2e:0370:7420
          192.0.2.1
          192.0.2.2

This will give you the IP addresses of the site which you can compare to the global test in part 1. If they match, you have the up to date IPs, if not you may have a cached value.

What to do if you do have a cached value
You can try running the command ipconfig /flushdns in the same way as shown above to flush the DNS resolver cache on your machine. Your cache will also clear over time if you don’t mind waiting.

Mac

Useful commands in Linux include ping and dig

To open the terminal:
The Terminal can usually be found under Applications > Utilities and will look something like:image

The command
To see the DNS values your computer sees, we will use a command called dig. Enter this in your command line:
dig A domain.tld +short for the A records (IPv4 addresses) and dig AAAA domain.tld +short for the AAAA records (IPv6 addresses) replacing domain.tld with your domain name. the +short just gives you the IPs, leaving that off gives more detail which we don’t need for this. Then press enter/return to run the command.
You will get a response that looks something like this for A:

192.0.2.1
192.0.2.1

or like this for AAAA:

2001:0db8:85a3:0000:0000:8a2e:0370:7334
2001:0db8:85a3:0000:0000:8a2e:0370:7420

This will give you the IP addresses of the site which you can compare to the global test in part 1. If they match, you have the up to date IPs, if not you may have a cached value.

More information about the use of dig can be found in this post: DNS Sleuthing with Dig

What to do if you do have a cached value
Your cache will also clear over time if you don’t mind waiting. You can search for ‘Flush DNS Cache’ and your OS version number for specific guidance if this doesn’t work. The command for the last major versions (macOS 10.12 Sierra and later) is:

sudo killall -HUP mDNSResponder;sudo killall mDNSResponderHelper;sudo dscacheutil -flu
Linux

Useful commands in Linux include ping and dig

To open the terminal:
Opening the terminal will vary on different linux distributions, however the icon normally liiks something like: image and often appears on the dock or under ‘Administration’ in the menu.
You can also use the shortcut Ctrl + Alt + T.

The command
To see the DNS values your computer sees, we will use a command called dig. Enter this in your command line:
dig A domain.tld +short for the A records (IPv4 addresses) and dig AAAA domain.tld +short for the AAAA records (IPv6 addresses) replacing domain.tld with your domain name. the +short just gives you the IPs, leaving that off gives more detail which we don’t need for this. Then press enter/return to run the command.
You will get a response that looks something like this for A:

192.0.2.1
192.0.2.1

or like this for AAAA:

2001:0db8:85a3:0000:0000:8a2e:0370:7334
2001:0db8:85a3:0000:0000:8a2e:0370:7420

This will give you the IP addresses of the site which you can compare to the global test in part 1. If they match, you have the up to date IPs, if not you may have a cached value.

More information about the use of dig can be found in this post: DNS Sleuthing with Dig

What to do if you do have a cached value
You can clear your DNS cache using commands, however it may vary by distribution and version. Your cache will also clear over time if you don’t mind waiting. You can search for ‘Flush DNS Cache’ and your distribution and version number for specific guidance if you don’t want to wait.


3. Formatting command responses to post here on the community
If you post the output of commands here on the community, they can be formatted in an unexpected way. To prevent this, add ``` on their own on the lines above and below any outputs so they are treated as code. This will make it easier for members on the community to interpret the output and help them help you.

Note: This tutorial contains links to external resources over which we have no control. As always, any commands you run on your own device are at your own risk.



Tutorial Reference: CT-44

Reviewed: 04/20

This is a Community Tutorial, most are wiki posts, so can be contributed to by Regulars and MVPs here. If there is a tutorial you would like to see, you can request one here.

If you would like to provide any feedback on this tutorial, please post in the #Meta category, tag your post #TutorialFeedback and let us know the Tutorial Reference above.

Other great resources on this community include the Community Tips . These address best practices when configuring Cloudflare, how to fix issues you may see, and tools to troubleshoot. Also you can view Expert Tips, great posts on the community from people in the know that may help you with your issue.

We encourage users to check out these great resources and the Cloudflare Support Centre before posting


1 Like