DNS Explained: What it is and how it works
Let us imagine the following scenario
You have a question. You need an answer. Where do you go?
Google.
You open your web browser and type “google.com”.
Google opens, and you make a search for your question. Done.
Hold on -- how did your browser know what “google.com” meant?
DNS.
DNS What?
The DNS is an acronym for Domain Name System. In simplest terms, the DNS is a large collection of records. You could imagine the DNS as a large spreadsheet, where the first column contains the IP addresses, and the second column contains the domain names, such as google.com
Domain? IP address??
An IP address stands for Internet Protocol Address and is a series of numbers and dots and looks like this:
123.456.789.0
An IP address is essentially a map for computers that helps them locate other computers within the same network (in this case, the internet). The numbers in-between the dots are the coordinates.
There are two types of IP addresses: IPv4 and IPv6. The IP address in our example above was an IPv4 address. The only difference between them is that an IPv6 address is a lot longer, contains both numbers and letters, and separates the coordinates with colons instead of dots.
What about domain names?
A domain name is the human-readable alternative to an IP address. An example domain name would be:
Typing Google’s IP address into your browser will load Google's website. Likewise, typing google.com into your browser will load Google's website.
How is this possible?
Again, DNS. In a nutshell, this is what happens when you type google.com into your browser:
> Browser: Hi DNS, please tell me what google.com means
> DNS: Hi browser, google.com means 123.456.789.0
> Browser: Okay, let me ask 123.456.789.0
> 123.456.789.0: Hi browser, I am sending you a 'lil something
> Browser: Thanks! Loading...
> Browser (after a short while): Awesome, google.com has loaded! I shall display it.
It’s worth noting that the DNS itself is a distrubuted system of computers, and your device talks to it using an IP address. Whenever your device connects to your internet service provider (for the first time), it receives a DNS IP address, which is used (like we established) when your device needs to figure out what a domain means.