Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DNS browser question

Status
Not open for further replies.

redss

Programmer
Oct 20, 2002
195
If I type into my browser, how does the browser resolve the IP address?

Which of the following scenario is correct:

a) My browser queries its DNS to get the IP address for foobar.com, then sends the http request to the IP address

OR...

b) my browser queries its DNS to get the nameservers for foobar.com, then queries the nameservers for the IP address, then sends the http request to the IP
 
Technically neither is correct. If you type in you would not get the address for foobar.com. The of the address space is a host, like computer1.foobar.com. To resolve your dns has to have a host rescord for points to the IP Address you are trying to resolve.

Hope this helps...
 
Actually my question was essentially how many queries does the browser have to make... please assume that the domain is the same in each case, ie. that foobar.com was typed in rather than (sorry for the typo)
 
Gotcha...

Your client only has to make one query to its local DNS server, if the server is authoritative for the foobar.com zone then is send a successful response to the client. If it is not successful the the DNS server itself takes on the responsibility of finding the DNS server that is authortative for the foobar.com. It then contacts the root domain DNS server for ".com" The root server will respond to your DNS server. When your DNS server receives a successful response from the other DNS server, it forwards the response back to you client.
 
Ok so the local DNS server finds out both the DNS for the domain and the IP, and returns the IP to the browser after a single query?

That's how I thought it worked too... until I read a conflicting description at
Interesting...
 
The description in the Link states the same thing in my post above.
To determine which primary name server contains your Domain Name Records, a local name server contacts the root domain name server maintained by the InterNIC.

The root domain name server then returns the IP address of the primary name server responsible for the domain being requested.

The primary name server becomes the next machine contacted by the local name server.

So your local name server does all the work from the single request it received from the client.
 
Thanks for the clarification.

Did you note that the illustration in that link makes it look like the browser is performing an extra DNS request? (it doesn't look like their illustration matches the description)

So the browser performs a single DNS query and the local name server does all the work to find the IP... but then the browser still has to send the http request once it has the IP... I understand!

Thanks again!
 
The diagram shows the browser doing all the work, which doesn't match the description. The description is correct.

The browser will make two requests- one to get the IP from the DNS server(s) configured in the OS, and a second to the IP address that it receives. All the other DNS-related activity is handled by the "local DNS server", which isn't shown on the diagram.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top