DNS (Domain name service) is the translation of human readable text, into IP addresses - but why is this so important?
Well, networks (and the internet is a very big one!) don't read domain names, they use IP addresses. DNS is responsible for taking a domain name i.e gelstudios.co.uk and converting it into an IP address such as 192.168.0.1
Every domain name can have multiple DNS entries for it, which allows us to point traffic to different places, subdomains, emails e.t.c
How does DNS actually work?
This is an important thing to understand.
When you query a domain name, you don't connect to that website directly, it's done through a series of nodes. Each of these nodes, including your very own computer, can cache DNS - all in a bid to make loading your request at fast as possible.
What this ultimately means, is that if a DNS entry is updated (a website move, or a change of some sorts), it doesn't happen immediately.
The amount of time that it takes to update everywhere, is called DNS propagation.
DNS is a bit like sending a letter...
When you send a letter, if doesn't go straight to the recipient - it has a journey to travel, let's compare that journey, to that of a typical DNS query.
There are a few things we need to establish:
- The letter that you want to send, is your initial request for a domain name.
- The postman collecting from the postbox, and taking it to the sorting office, this is DNS taking your request, and taking it back to nodes to turn that request into an IP address.
- The collection schedule of how often the postman checks the postbox, this is your TTL (Time to Live), should we use the cached values we have? Or should we check for any updates?
- The sorting office, sending your letter onto its end recipient - which is connecting you to the IP address for your first request.
DNS propagation - can we avoid it?
In short, you can't, however by using TTL (Time To Live) and a bit of forward thinking - we can reduce it!
TTL sets the amount of time that each node should cache the entries for. Setting this as low as possible in preparation for your change can help massively! However, you need to do this before you change anything, as it's only when your DNS is fetched from a node, that the updated TTL will be taken into effect!
For example, if your existing TTL is 60 minutes, and you change it to 5 minutes, it will take approximately 60 minutes for all the nodes to recognise that your TTL has changed, and then a further 5 minutes there after for any changes made to be in actual effect.
If we use our example above, we've just changed the collection schedule for the postman from an hour, down to every 5 minutes. Thats a lot of work for a postman isn't it? Browsers and devices see this the same way! If you set your TTL too low, it may be ignored...
So, if i update my TTL everything's guaranteed - right?
Unfortunately not. Sorry.
We may set the TTL with a time of how we would like things to be updated, but in actual working practice, nodes, ISPs (Internet service providers), browsers (Chrome, Firefox, Safari, Edge e.t.c), and even devices (mobile phones, tablets, computers e.t.c) each have their own set of caching rules which may, or may not respect the time you put in place.
Each has their own agenda, but most are for the benefit of speed.
Anything I can do to speed up DNS propagation?
Firstly, you want to ensure that your change has actually taken effect. You can use various tools on the internet for this, we recommend whatsmydns.net and their tools.
Once you've confirmed that it's correct - there are several things you can try which I've listed below.
1. Clear your browsers cache
There are many methods of how to do this. Here is a great website with guides for each modern browser and how to clear its cache.
2. Flush your devices DNS cache
A bit more extreme than the first method, this will clear your entire devices DNS cache. Another link here for guides about how to do this on your device via terminal/command prompt.
3. Restart your router
Your router may well be caching DNS too, try rebooting it. This will force a new connection to the internet, and may help with clearing that DNS cache, this in turn will effect all devices connected on that same network. Repeat the above steps as required.
4. Contact your internet service provider
If all else fails, contacting your ISP and seeing if there is anything they can do may help. Again, your ISP may be caching DNS records. This is typically outside of your control.
DNS propagation is there to help with speed of delivery, which is a good thing! Unfortunately, in a bid to make things even faster, other levels of caching have come into play which has added complication to the process.
All of these issues can however be overcome with planning. Plan your change in advance, and adjust your TTL before you do anything and then most importantly...