DEV Community

Cover image for Introduction to DNS and Why DNS records are needed?
Bhupesh Chandra Joshi
Bhupesh Chandra Joshi

Posted on • Edited on

Introduction to DNS and Why DNS records are needed?

Domain Name System(DNS) is a database records or you can say dictionary for managing hostname and their associated ip addresses.DNS server maps all domain names to their ip address.DNS servers allow computers and mobile to work all together. It is a phonebook of internet or a novel of website ip address.

What do we remember when searching a number on a phone book, it is the name of the friend, domain name is the name of the website and you search a domain on internet and you type www.google.com and it requests to ISP and ISP communicate with dns(domain name server) for address of your website.

How does DNS Works?
You can consider the DNS server working just by the habit,the person who drinks a tea, he needs the tea after 4 to 5 hrs. Same things perfomed by dns as a habit which is a repetitive task. You type a url on the browser and brouser sends the request to isp(internet service provider-ex-airtel , AT&T, Verizon) and isp provider sends the request to domain name system(dns) server, domain name server sends the request to top level domain server for .in, .com or .ai and autherative domain server returns the address of the website.

.in, .com and .ai servers returns the ip address of particular domain and autherative domain server returns the ip of your domain name or website. If you have purchased a domain from Godaddy then your domain's ip address will be returned by Godaddy.

A server returns the ip address of your website.

Best difference between client and server is the roles they play ⏯,it's play and pause analogy, play a video sending request(its request) and pause getting a response.

Hostname is human readable nickname

dev.to = dev is the nickname domain and .to (part) is the top level domain, also known as domain extention.

Problem: You need to purchase the domain name from different provider and hosting from different provider
Solution:
Vercel provides the domain name , hosting and automatic fast deployment services, so If anyone wants a domain, he will look for vercel, things are simplified.

Decentralized server - You can communicate with git ,that is forms a decentralized server, your autherities are divided into the multiple levels, pr will be approved by the Manager , and it mitigate duplication of sending artifects to peers, it's peer to peer computing.

IS DNS Decentralized server ? YES,It is a decentralised server just like git, we have 13 root level servers, it also communicate and collaborate with name servers and autherative domain servers.

What is the delegation?
The term Delegation offers the team growth and it is also a important skill to learn, delegation means you are transfering your work to other team member to foster the deadline.

DNS delegation is also refered as redirecting your website to the sub-domain and if I have deployed my application on vercel,it redirects my website to child domain-stress-reduction-bot

In development regime, Loose coupling is a software design principle ,it is just like school principal, don't look spelling , you need to look at the content,the loose coupling is Independent of spelling mistakes,for example you are creating a ford object, same time you can create a maruti object, this shouldn't break your system, this is the loose coupling. Your work should not affect the team's work.

If you create changes on one part of your project,it should not impact the other part of your code, for this purpose we will create api's which are loosely coupled, and one api isn't independent on the another one. ex- You are creating a api changing bot for your v0 then you fist select the google gemini api,it's credits are over then you select the open ai api , so open ai api should not affect the gemini api, this is loose coupling.

Presentation of a Single domain that uses the multiple records-

What is load blancing?

What is the A record?
A stands for address, ipv4 address(32-bit numbers -written in dotted decimal notation-ranging from 0 to 255,format :152.168.1.2)

A record maps the domain to the 32 bit numerical format ex- x.com/bhupesh336 is mapped to 152.168.1.2,and x.com/bhupeshcoding is mapped to 152.168.1.4 .

So,the a record is common for Distribute traffic (load balancing). For example ,facebook has different server for India and USA.

The difference major difference between A record and AAAA record-

A record maps the ipv4 address to the domain name and AAAA record starts mapping of 128 bits ipv6 address to map domain name with ip.

Scalability doesn't comes from A record or AAAA record ,but these can help you manage the trafic of your website.

How does CNAME (Canonical Name) differs from A record?

Take an example of import
import React , { useState as bhupesh } from 'react';

function MyComponent() {
// Usage: bhupesh() instead of useState()
const [name, setName] = bhupesh('Bhupesh');

return

Hello, {name};
}

There I have mapped useState to Bhupesh, so similarly cname (canoniacal name) maps the site-name to another name for example www.example.com is mapped to example.com.

A record is record of ip address and CNAME is the settings built for website nickname, for example instagram is called insta in sort.

Do you know that how youtube sends us email, you have uploaded a video or suscribed a channel, youtube configure the mx record for sending email, you will get email from example@youtube.com. mx(Mail eXchange) tells your domain that where you need to send the email from your domain.

DO you know What is the NS(Name Server)?
If you discuss about the ns which is similar to Glucoze which is injected to human body, now you will say that we are discussing the networking.

In networking terms the name servers helps the domain to connect to the ip address of your website.

Top comments (0)