What is DNS propagation?
You've added a new domain name to your account, just changed your nameservers or recently modified some DNS settings. However, they aren't working yet. You've discovered already that it's not working yet because of something called "DNS Propagation". But what does that mean?
Introduction to DNS
Before you can understand how DNS Propagation works, you need to understand how DNS itself works. So let's start with that.
Servers on the internet are identified by a set of numbers called an IP address. This set of numbers looks like this: 220.127.116.11. However, a set of numbers like that is very hard to remember, so a textual alias is created for the IP address, which in this case is example.com. However, when you type example.com in your browser, your computer still needs to know the corresponding IP address. So how does it do that?
That's where DNS comes in. A DNS query starts at the root nameservers. These are the main nameservers for the entire internet and your computer has a list of these built in so it knows where to start. Your computer will ask these main nameservers "What is the IP address for example.com?".
However, these root nameservers don't contain all DNS records in the world. However, they do know who controls the .com domain extension, so they return the list of nameservers responsible for the .com extension. Your computer then queries one of the nameservers responsible for the .com extension, again asking where example.com is.
However, the .com nameservers don't know here example.com is hosted either. However, they do know which nameservers are used for example.com. These are the nameservers configured by the owner of the example.com domain and often are the nameservers from the hosting provider of the domain name. Next, your computer queries the nameservers from the hosting provider asking where example.com is. And finally, the nameservers return an IP address, which your computer can then use to access the website.
And that's how a DNS query works. However, as you can read, there are quite a few steps which need to be taken to find an IP address, and going through all of those for every single hit would make browsing very slow. Fortunately, two additional measures have been introduced to reduce the time it takes to find an IP address.
The first measure is DNS caching in your computer. After your computer has completed it's DNS lookup, it will temporarily store the result. So when you view the next page, your computer can simply return the IP address from it's own storage rather than having to look it up again.
The second measure however is far more important: DNS Resolvers. Typically your computer doesn't do the DNS lookups itself. Instead, your computer has been configured with a so-called DNS Resolver. The DNS resolver is a (set of) DNS server(s), usually operated by your internet service provider, which handle the DNS queries for it's users. So when your browser does a DNS lookup, it will ask the DNS resolver "What is the IP address of example.com?". Next, the DNS resolver will query all of the other nameservers to find the IP address corresponding with your domain name. It will also temporarily store these results so the next time a user tries to visit the domain name, it doesn't need to look the IP address up again.
Using a DNS resolver has two big advantages. First of all, the DNS resolver is used by many people, typically all the customers of an internet service provider. So the resolver generally has the locations of almost all popular websites stored already, so the results can be returned very fast. Additionally, the DNS resolver has a lot better internet connection than is possible from a home, so it can do the queries itself faster than your own computer can as well.
To summarize all of this, here is a graphical representation of a DNS query:
All of these mechanics help to ensure you can have a fast and comfortable browsing experience.
What does DNS Propagation have to do with this?
As you have read above (or maybe already know), the DNS settings of a domain name are cached on multiple levels. This helps to ensure a fast browsing experience, but also means it can take some time for changes to be visible.
When you change the DNS settings of your domain, the nameservers will immediately start serving the new details. However, a DNS resolver which has queried the nameservers moments before has found the old settings, and it's currently serving these old settings to it's users, believing that the settings are still correct because it has retrieved them a short time ago. And because the resolver doesn't check the nameservers again, it doesn't know it's settings are out of date.
How long it takes for the settings to be updated by the resolver depends on the resolver in question and how it's configured. If you have a good DNS resolver, like Google Public DNS, the records are refreshed every few minutes so you'll see the new settings in action very soon. However, other resolvers, like mobile internet providers in developing countries, can store outdated records for weeks!
And after a DNS resolver has updated its settings, the computers of it's users may still have the old records stored in their own cache. Those stores have to expire first before the computer will check the DNS resolver, which will then return the correct settings. This computer cache can increase the waiting time even further.
This process of waiting for the new DNS settings to be picked up by DNS resolvers and finally it's users is what's called DNS Propagation. And the duration of this differs for each visitor, their internet providers, their DNS resolvers in use, their operating systems and their configurations. Some users pick up the new settings in a few minutes, others take weeks.
This is simply an unfortunate characteristic about how the internet works and it's not something website owners or hosting providers can fix. So you'll just have to remember that when changing DNS settings, it can take some time for changes to be visible.