DNS: Introduction
DNS is the Internet's directory service. Let's jump right in!
How Do We Find Things on The Internet?
Generally, using one of the following ways:
- Addresses or locations that specify where something is.
- Just like with a physical address, we still may need a map to get to the address. On the Internet, the addresses are typically IP addresses, and routers know the map.
- Names. In particular, domain names, or the unique name that identifies a websites, are mapped into IP addresses based on lookup service that uses a database. The most well-known lookup service is the Domain Name System (DNS). So when you enter the URL ‘educative.io’ into your browser, it uses DNS to find the actual IP address of the server that hosts it.
- Content-based addressing.
- The content itself is used to look up its location.
Note A Useful Analogy: Domain names are like actual people names and IPs are like phone numbers.
In this lesson, our focus will be on DNS, the client-server application layer protocol that translates hostnames on the Internet to IP addresses.
At the core, the Internet operates on IP addresses, but these are difficult to remember for humans. So, DNS names are preferably used at the application layer for which the DNS provides a mapping to IP addresses. For example, HTTP first translates the DNS hostname provided by the user in the URL to its IP address and then attempts to connect to the server. Furthermore, DNS is not just a protocol. It also consists of a distributed database of names that map to IP addresses. So essentially it’s a directory service.
Distributed Hierarchical Database
One single database on one single server does not scale for reasons such as:
- Single point of failure. If the server that has the database crashes, DNS would stop working entirely, which is too risky.
- Massive amounts of traffic. Everyone would be querying that one server. It will not be able to handle that amount of load.
- Maintenance. Maintaining the server would become critical to the operation of DNS.
- Location. Where would the server be located?
This is why DNS employs several servers, each with part of the database. Also, the servers exist in a hierarchy. To understand this hierarchy better, you need to understand how URLs are broken down into their hierarchies. Have a look at the following diagram.
Get hands-on with 1400+ tech skills courses.