Search code examples
network-programmingdnstcp

DNS working based on layer to layer of OSI layers


How actually DNS will work based on different layers of OSI? I mean when we will type google.com, it will mapped IP Address of google.com with its domain name.But when we are not knowing the IP address of Authoritative DNS server, so how it will move to different Layers of OSI (TL,NL, DLL) of our system to Authoritative DNS Server?


Solution

  • Your assumption is not correct, as in reality the DNS works as a application layer service. It is not a layer-to-layer service of OSI layers.

    DNS is an application layer service that uses UDP, which is part of the TCP/IP stack.

    When we type www.google.com, it is the workhead of application referred to mapping into IP-Address.

    The application will invoke the client side of DNS, specifying the hostname that needs to be translated. (On many UNIX-based machines, gethostbyname()a Web Browser or a mail reader) is the function call that an application calls in order to perform the translation.) DNS in the user’s host then takes over, sending a query message into the network. All DNS query and reply messages are sent within UDP datagrams to port 53. After a delay, ranging from milliseconds to seconds, DNS in the user’s host receives a DNS reply message that provides the desired mapping. This mapping is then passed to the invoking application. Thus, from the perspective of the invoking application in the user’s host, DNS is a black box providing a simple, straightforward translation service. But in fact, the black box that implements the service is complex, consisting of a large number of DNS servers distributed around the globe, as well as an application-layer protocol that specifies how the DNS servers and querying hosts communicate.

    SOURCE: Computer Networking: A Top-Down Approach.