The DNS Lookup Journey

  1. My browser looks at its DNS cache to see if it’d been there before and knew the IP address mapped to it. Let’s say it didn’t.
  2. My computer also looks into its local DNS cache to see if it knows an IP address mapped to that domain. Nope.
  3. My home router comes in to try its local DNS cache. Still no luck.
  4. We go out to ask my ISP’s DNS server if that domain is in its cache. Sorry it is not there, but that recursive DNS server can help us resolve it.
  5. The resolver goes to ask the root name servers about the domain name, let’s say it is example.com
  6. Root name servers know all the TLD (top level domain) name servers. Since we came with a .com domain, it forwards our query to one TLD name server that handles .com domains.
  7. The .com TLD name server knows the authoritative name server who stores DNS record for the domain example.com so it forwards the query ahead.
  8. The authoritative name server respond with an A record (address record which is an IP address) mapped to the domain name.
  9. The IP address was then passed all the way back to our browser, each one in between who has a DNS cache will cache it on the way so next time when we or someone else asks about example.com, the answer comes faster.
  10. Browser opens a TCP/IP connection to the IP address, which is the address of the server hosting example.com, then sends an HTTP request. If the server is up and running, it sends back HTTP responses to our browser.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Xiaoli Shen

Xiaoli Shen

193 Followers

Solutions Architect at AWS. 10 yrs in software engineering and counting. Posts are my own.