How does DNS works?
When you are browsing to https://nickvanhoof.com, how does your machine know where to find the address of nickvanhoof.com
It turns out that when you are going to nickvanhoof.com, you are actually surfing towards the address 22.214.171.124.
The moment you type nickvanhoof.com and hit enter, how is this domain name linked to that specific IP address.
1. Local Machine
Your local machine keeps a cache of some domain names and the IP addresses linked to it. Suppose the domain name is not in the cache. The request is now forwarded to your local dns resolver.
2. DNS resolver
Most internet providers (ISP) run DNS servers for their customers. These can act as a resolver to figure out the address. They also keep a cache of domain names and according IP addresses. Again, let’s assume the address that we are looking for is not in the cache. When the address is not found in the cache, the request is forwarded to a Root Name Server.
3. Root Name Server
The Root Server does not know where to find nickvanhoof.com. However, it points you to a top level domain server for the .com domains.
4. TLD server
The top level domain server, again, does not know where to find nickvanhoof.com. But if you have a .com top level domain, it can forward you to the next place. the TLD server knows the address of the authoritative name server that knows all about nickvanhoof.com. So, it points you to this authoritative name server.
5. Authoritative name server
This one knows all about nickvanhoof.com and returns the ip address for the domain name.
End of the journey
Quit the journey to figure out where to find nickvanhoof.com!
And it all happens in a fraction of a second.
* The number of Root servers is limited to thirteen server addresses. However, by means of the anycast principle such an address might lead to multiple destinations. So in reality, there are a lot more then thirteen destinations for the root servers.
** Root Name Servers, TLD servers and Authoritative Name servers are all categorised as DNS servers.
*** Each number in an IPV4 number before or after a dot is called an “octet” because it’s a base-10 equivalent of an 8-digit base-2 (binary) number used in routing network traffic. Eg. 126.96.36.199