What is DNS? What is Fully Qualified Domain Name (FQDN), Domain Name Levels, How DNS works between client and server?
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.
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.
In
this example, the protocol is HTTPS, com as a top-level domain, website at the
second level, and API is the third level.
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. 
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