title: DNS second-level domain lookup
body: <p>How does DNS second-level domain lookup work?  For example, in a url web.example.com, the top-level domain is .com, and the second level domain is .example.  Based on my understanding, after we find a server for the top-level domain, if this top-level server does not actually have a record for the second-level domain, we query a different top-level server.  How does DNS decide which next top-level domain server to query?  Are there a lot of top-level domain servers in the world (since there are so many second-level names available)?  Since there are so many second-level names, how long could this process potentially take?</p>
  
  <p>This is described on wikipedia: <a href="http://en.wikipedia.org/wiki/Domain_Name_System#Address_resolution_mechanism" rel="nofollow">http://en.wikipedia.org/wiki/Domain_Name_System#Address_resolution_mechanism</a>, but this section does not explain how to efficiently find the top-level server with the second-level domain info.  </p>
  
  <p>The point of my question is how does DNS efficiently search millions/billions of second-level domains.</p>