What is DNS? DNS server and DNS record.


DNS stands for Domain Name System. It is an essential requirement for the Internet. Some servers convert a URL to the actual IP address of the machine, which hosts the service for a URL. The DNS server maintains the mapping between the URL and IP address. DNS is a database that maps a domain to one or more IP addresses. The multiple IP addresses for a URL enable a website to load faster and provide redundancy.

Why DNS is required?

The answer is simple. It is easy to remember the alphabetical name rather than numeric values. The same applies to the domain name, which is a string, e.g., www.cspsprotocol.com. It is easy to remember the name www.cspsprotocol.com rather than the hosting server IP (13.4.xx.xx). A DNS server is just like a phone directory located on a central public IP. If a service provider changes the hosting, the public IP will change but not the name. No need to update the DNS mapping. So without DNS, it is impossible to change a website’s hosting freely.

What is a DNS record?

You can think of a DNS record as a dictionary on a DNS server. The information maps the domain name to the serving IP address and how to handle the DNS query for that domain. For example, besides IP mapping, each record has a Time to Live (TTL) parameter that decides how often the information will be refreshed.

How does a web browser know the DNS IP address?

While doing web browsing, nobody cares what the hosting machine’s IP address for a domain is. This is possible because of DNS servers. But how a machine knows the IP address of the DNS server? The answer is that it is configured on the computer you are using. When a browser tries to send the request out, it first does DNS query to resolve the website name into the IP address.

Where is the DNS address configured?

The configuration is done along with the IP address assignment. Most of the time, we use broadband to access the Internet.

If the wireless router has a static IP configuration, the DNS server is configured on the wireless router. The DNS server address is configured on ISP if the DHCP is used.

Maybe the question is how our PC looks for a URL from other machines or routers. The answer is the machine IP configuration. The machine IP can be static or from the DHCP server. For static IP configuration, Go to the change network adapter settings->right, click on the network adapter->click on properties, and select TCP/IP settings from network properties. The following screen will display.

Static Ip Configuration
Static Ip Configuration

IP Address is the local IP address of the computer in LAN.

Subnet Mask: This is according to the network, and the IP  subnet depends upon network class type. This sets how many bits are for the network id and host id. The screen shown is an example of a class c IP address. In this maximum host can be 254.

Default Gateway :

This is the address of the next hope. Here 192.168.1.1 is the router’s IP address which connects the internal LAN and public Internet. By default, all requests will be sent router. The DNS query will also be sent to the gateway. Gateway does the name resolution, and the response returns to the client’s computer on LAN.

DNS Server Address: 

Optionally you can also configure the DNS server if you want to use a separate server for domain name lookup. Some companies may have a dedicated server for DNS only.

In the case where IP allocation is via DHCP. A computer on LAN gets the IP address and default gateway from the DHCP server. Routers have options for the DHCP server.

What is DSN caching?

Caching is the process of holding information for the time being. This enables lookup faster. DNS also uses caching for domain name lookup. When a DNS lookup response comes. The answer is saved in the cache.

The first cache is maintained in the web browser. This is the first level of caching for domain lookup. So when a URL is typed in the browser address bar, the browser performs the lookup in the local cache. No mapping, then a second-level lookup is performed.

The second level of cache is the computer. One can get the caching details from the following command in Windows.

C:\>ipconfig /displaydns 

This will display details in following format. 

www.cspsprotocol.com
----------------------------------------
Record Name . . . . . : www.cspsprotocol.com
Record Type . . . . . : 5
Time To Live . . . . : 9631
Data Length . . . . . : 8
Section . . . . . . . : Answer
CNAME Record . . . . : cspsprotocol.com


Record Name . . . . . : cspsprotocol.com
Record Type . . . . . : 1
Time To Live . . . . : 9631
Data Length . . . . . : 4
Section . . . . . . . : Answer
A (Host) Record . . . : 43.255.154.29

The third level of caching is on the internet service provider (ISP) side.