What is the DNS and how it works?
When we input the domain, how can we receive the web page? Let’s study about DNS.
Basically, all computers identify each other by the number and using that number they can communicate. We called this identity number as IP Address.
But let’s think one more time. When you use the web service, you haven’t input any number, right? I convince you input the name of the web site such as www.google.com
. We said this as Domain Name.
When we enter the domain name, one service that named Domain Name Server(DNS) provide mapping domain name and IP address service.
Terms
- DNS Resolver
Server on the internet that converts domain name into IP address. - TLD(Top Level Domain)
Domain at the highest level in the hierarchical Domain Name System..com
,.org
,.net
is the examples of the TLD. - Authoritative Name Server
Server operated by organization that has the authority for domain delegation. - TTL(Time To Live)
The life time of the data in the computer or network.
Process
- User input
www.example.com
domain name to address bar of Browser. - Domain name
www.example.com
is going to be routed to DNS Resolver by the ISP. - DNS Resolver sends request about
www.example.com
domain name to DNS Root Name Server. - DNS Root Name Server provides the information about Name Server for .com TLD that has information about
www.example.com
domain name. - DNS Resolver sends the request about
www.example.com
domain name to Name Server for .com TLD. - Name Server for .com TLD provides information about Authoritative Name Server that has the data about
example.com
domain name to DNS Resolver. - DNS Resolver sends the request about
www.example.com
to Authoritative Name Server. - Authoritative Name Server searches and sends the IP address
123.123.123.123
which is mapped towww.example.com
domain name to DNS Resolver. - DNS Resolver caches the mapping information.
(e.gwww.example.com
:123.123.123.123
)
Cached data will be saved to DNS Resolver during TTL(Time to Live). - DNS Resolver sends IP address
123.123.123.123
to user’s Browser. - Browser accesses to Target Web Server(or resource) using received IP address
123.123.123.123
. - Target Web Server sends web page to Browser.
- Browser displays web page to User.
The way of load balancing from DNS
If too many request has been occurred on one domain name, load has occurred on server, and speed of server will be slow. So we need to load balancing.
There are two ways to load balancing.
- Round Robin DNS
- IP Anycast
Round Robin DNS
This is way of multiple IP addresses is allocated on one domain.
If request enters to DNS, DNS sends one of registered IP addresses randomly that mapped target domain name.
From this below link, you can find more detail information about what is Round Robin DNS.
IP Anycast
In IP Anycast, that organizes multiple server as group to share one IP address.
If request enters to DNS, DNS maps the request to server that is nearest from DNS.
The target mapping server(nearest server) is decided beforehand by the ISP. So through this way, we can customize resources by the location.
CDN Services are provided using IP Anycast.
From this below link, you can find more detail information about what is IP Anycast.
Conclusion
I thought that DNS is just 1:1 mapping, but it was my fault. It’s more difficult than what I thought. And it was interesting that CDN is implemented by way of DNS load balancing.