How the Domain Name System (DNS) works?

What is DNS? What is Fully Qualified Domain Name (FQDN), Domain Name Levels, How DNS works between client and server?

Domain name system

WHAT IS DOMAIN NAME SYSTEM (DNS)?

DNS stands for domain name system. It is the backbone or core of the internet. The main responsibility of DNS is to resolve domain names or fully qualified domain names to IP addresses. Also, there is so-called reverse DNS when IP addresses are resolved to domain names.

Fully Qualified Domain Name (FQDN)

Every domain consists of many levels and the levels are numbered from right to left and they start with the top-level, second-level, third-level, fourth-level, and so on. But the greatest quantity of levels in every domain is three top-level, second-level, and third-level. FQDN is a part of the URL that is located between those two forward slashes.

https://play.google.com/store/movies?ref=341

In this example play.google.com is FQDN and it is a full domain name for a specific host on the internet. In most cases, people omit fully qualified and say domain name play.google.com in this example.

dns translates domain names to the IP address

In this diagram, the client-side of interaction with DNS server and usage of DNS. For example, if the host on the application layer at the level of HTTP protocol wants to send some data to a remote server. And it knows only its domain name for example google.com. It doesn't know the IP address and the network layer of the CPP model. The host requires to know the destination IP address to be able to send a packet to the remote host that is where DNS helps. The host has a set of DNS servers. Those settings are sent by DHCP servers to any host that obtains an IP address and other parameters via DHCP sends a request asking for the IP address of google.com. So in DNS request-host asks for the IP address of google.com and the DNS server in response returns the actual IP address of the google.com web server or any other server, not a web server. Then the host establishes on transport layer TCP or UDP connection with such a remote server knowing its IP address and on the network layer, the host is able now to add the IP version 4 or IP version 6 header. Where source IP will be IP of this host and destination IP will be IP address that was retrieved from DNS server.

A simple interaction host sends a single request to the DNS server asking for the IP address of a specific domain name. DNS server returns such IP address or set of IP addresses. Because it is also possible to return several IP addresses instead of one and in such case, the host may select one of offered IP addresses and establish a connection to that IP address. That allows us to load balance among different servers’ IP addresses. But this picture demonstrates only client-side interaction with DNS on the internet site there are much more servers than this single DNS server. And there are root name servers, top-level domain name servers, and authoritative name servers. DNS is used for the resolution of the domain name or FQDN to IP address.


Domain Name Levels

Any specific string in the search bar of the web browser you enter URL. It is a unique identifier for different resources on the internet. Every URL consists of a protocol, sub-domain, top-level domain, optional path, and optional query string. Every domain name consists of many levels and levels are counted from right to left.

Domain name level

In this example, the protocol is HTTPS, com as a top-level domain, website at the second level, and API is the third level.

Domain name level example

In the next example, four levels for a specific domain. The top level is the uk, the second level is co, the third level is amazon, and the fourth level is www. WWW is not a specific prefix it is a part of the domain name. Some domain names may have WWW in front and some may not.


How DNS works between client and server?

Interaction between the DNS client and the DNS server is easy. There is a single UDP segment that goes from DNS client to DNS server and another UDP segment that goes back from DNS server to DNS client.

DNS works over UDP

Look at this DNS request client already know the IP address of the DNS server and it obtains such an address via DHCP. In this example, the IP address of the DNS client is 150.2.3.10 IP address of the DNS server is 8.8.8.8. It could be any other IP address and it matches with the IP address of the default gateway for the local area networks. For example, networks that you use at home. So in DNS request client asks for the IP address for a specific domain name and on the transport layer, it is sent over UDP. DNS client chooses any random UDP port greater than 1024 in comparison to DHCP there is no fixed source client port. In this example, you can see such ports as 2341 and destination UDP port is 53 it is well known reserved DNS port.

DNS works over UDP

In the network layer, the DNS client adds IP version 4 or IP version 6 header and in this example, source IP address is IP address and destination IP address is IP address of DNS server. So packet is sent to the DNS server. In this particular example, the DNS server is located in a different network than the DNS client. And if it is the case then between the DNS client and the DNS server there might be some routers that perform network address translation. We assume that there are no routers that perform net between DNS client and DNS server that is why we have chosen public IP address as IP address of this DNS client. So when DNS server receives such a request or query from DNS client and if it knows about IP address that is requested for a specific domain name by DNS client. Then it sends a DNS response and DNS response is sent from its local port 53 it is a well-known DNS port. The destination port will be the port used by the client for this initial DNS query request. The response will be sent from IP address 8.8.8.8 to the IP address of the DNS client which is 150.2.3.10. In this response, the DNS server will include information about the IP address of a specific target domain name. When such a DNS client receives the response it can create an IP packet and send it to its target server. That is how DNS works between DNS client and DNS server. Such DNS servers are called DNS resolvers. There are other servers behind DNS servers that are responsible for the resolution of specific domain names to IP addresses.

COMMENTS

Name

Artificial Intelligence,16,AWS,2,Big Data,2,Blockchain Technology,3,Cloud computing,9,Computer networks,4,cybersecurity,3,Database,2,Digital Marketing,1,E-commerce,2,Internet of Things,12,Quantum Computing,1,RPA,3,Technology,5,Web Scraping,1,
ltr
item
PS TECHNO BLOG: How the Domain Name System (DNS) works?
How the Domain Name System (DNS) works?
What is DNS? What is Fully Qualified Domain Name (FQDN), Domain Name Levels, How DNS works between client and server?
https://blogger.googleusercontent.com/img/a/AVvXsEjW0egyQifaOTwighNURfF94ztfhRxJrVCAv_gn6l4VrCd-DgD8V1GyJcOQXbTOE3tYErZaGD6s6IxF6Xt5XDpKsZZF7_CD39U0cblkr1YHDdy3tcvKkE3GoVh46ZCrIAP2RNkNA_Ci81rC11_XTBKnmUKFW_hYPEmNZY9hpbqmkGQatAanNJq8C1s5EQ=s320
https://blogger.googleusercontent.com/img/a/AVvXsEjW0egyQifaOTwighNURfF94ztfhRxJrVCAv_gn6l4VrCd-DgD8V1GyJcOQXbTOE3tYErZaGD6s6IxF6Xt5XDpKsZZF7_CD39U0cblkr1YHDdy3tcvKkE3GoVh46ZCrIAP2RNkNA_Ci81rC11_XTBKnmUKFW_hYPEmNZY9hpbqmkGQatAanNJq8C1s5EQ=s72-c
PS TECHNO BLOG
https://pstechnoblog.blogspot.com/2021/10/how-domain-name-system-dns-works.html
https://pstechnoblog.blogspot.com/
https://pstechnoblog.blogspot.com/
https://pstechnoblog.blogspot.com/2021/10/how-domain-name-system-dns-works.html
true
8274238297581439573
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy