The Domain Name System, also called DNS is responsible for matching the domain names that you type in your web browser’s address bar to the corresponding IP addresses that are assigned to the servers that provide you with the content you have requested. So, when you are looking for a website and make a request from your browser, the Domain Name System helps you find the server hosting the website you want to access. This means that every time you type a domain name in your browser bar, you are sending a request to a DNS server asking it for the IP address of that website or device (every device connected to the Internet has an IP address).
The Domain Name System is regularly compared to a phonebook that enables you to call any website. However, with DNS the “phone numbers” and corresponding names are kept safe and accessible for anyone with an Internet connection on DNS servers (name servers).
DNS servers are important, because every time you make a request to a website, your web browser does not start communicating directly with the intended webserver. Instead, the web browser first contacts a DNS server that then tells the browser the IP address of the website that it is trying to communicate with.
So, every time you visit a website, transfer files or send emails a DNS server is involved and is used to look up any domain names. You can avoid sending a request to the name server by writing the IP address directly into the browser. The IP of a website can be changed and one domain name may have a few IP addresses.
There are two Internet namespaces (of domain names and IP addresses) that are coordinated by DNS servers. The name servers store the information for all existing domain names and their DNS records. In order for this huge database to work effectively, there are millions of interconnected DNS servers that distribute the requests among themselves.
So, when you make a DNS lookup request (want to visit a website, send an email, etc.) you contact a local DNS server asking it for the IP of the website. If that server has the information for the domain in its database it directly sends it back to you. If it doesn’t have the information in its database it asks another server or more if needed. When the server receives the information from another server it sends it back to you and caches it in case there is more request for that domain later.