9. Application layer protocols

9.6. DNS protocol

DNS is a protocol, a service that translates human-readable domain names into IP addresses for devices on the Internet. Imagine a situation where DNS does not exist, but we want to display our favourite websites in the browser. We need to enter the IP address rather than the domain name, i.e. for example: 212.66.94.212. There are many websites on the Internet and it is difficult to remember many numerical addresses. What's more, it's easy to make a mistake in such digital records.

Also: the IP address of the server may not change very often. When our website changes IP address and the DNS service doesn't work, we have to re-learn that address and remember it. DNS solves this problem for us because it changes this address in its record database and assigns it to the domain name. Then for users it doesn't matter what the IP address of the site is, the important thing is to know its domain name.

DNS is a service that runs in a client-server architecture, but here we are not treating the clients as computer programmes such as browsers or file-sharing programmes. This computer only runs a system service called DNS Resolver, which handles all applications on client computers whose names need to be changed. Whenever we configure a network device, or just a computer, we should specify two DNS server addresses so that if one does not communicate, the other acts as a name substitution.

DNS servers store all sorts of records, including records containing end device addresses and records supporting mail exchanges, as it is important to remember that DNS not only translates domain addresses into IP addresses for websites, but also applies to the email server. The name swap looks like this:

1. The client sends a query to the DNS server, which checks whether the record exists in its database.

2. if so, translates the name into an IP address and sends it back to the client.

3. If not, it contacts other servers to have the record in question included in their database.

Sending requests to other servers for a DNS server that does not find a record in its database can cause a lot of network traffic, which is a confusing situation. To prevent excessive and unnecessary network traffic, when another server finds a record and sends it to the server assigned to your device, the latter saves the record in a cache, so that in future you do not have to refer to another server for the same address. This will speed up later name changes, as our DNS servers no longer search for records on other servers, but replace the names immediately. Similarly, DNS services on personal computers store previously translated names. This can be verified by entering ipconfig /displaydns on a Windows PC. We will then see which mappings are stored in our computer's DNS service cache.