Reputation: 5674
lets say that i have an a web browser. trying to connect to www.google.com.
the web browser send a DNS request on port 53 to the transport layer. the transport layer encapsulate the request into a segment on TCP and transfer it to the network layer.
the network layer identified the packet and use the defulte DNS server ip address and send it to the Link Layer.
The Link Layer use ARP and etc..
getting the response.
the Link layer transfers to the network layer , and here is my question :).
does the network layer hold any table of hostname to ip?
from now on , the response should bubble up to the application layer. dose the application layer add the ip that was extract from the dns request to the packet?
from what i understand the application layer should try to bind to a port , and then the transport layer should connect it some how via socket to the host name/ip or to report to the ip layer to do it.
but the question is how ?
thanks.
Upvotes: 1
Views: 1416
Reputation: 1259
The DNS response is simply a UDP packet containing a header followed by application-related data body. The data includes the domain name of the request, but this is for the benefit of the application that made the DNS request, not the network layer. The network layer does not analyse the content of the data body.
It's the application layer that decodes the DNS response packet and stores the IP address for subsequent use when it binds to a port; binding knows nothing about DNS names, it only knows IP.
Upvotes: 2