1

I have an URL that point to a specific page http://stackoverflow.com/questions/123. Assume that stackoverflow.com is 123.12.12.12. How does DNS map a specific URL to the specific page after identifying the IP?

AdamNYC
  • 19,887
  • 29
  • 98
  • 154

3 Answers3

4

It doesn't. DNS just tells you what IP address to connect to. It's the web server's job to map the URL to the page.

David Schwartz
  • 179,497
  • 17
  • 214
  • 278
3

DNS does not map URLs to pages, it is used strictly to look up host/domain names. URLs map to pages through the routing integrated into the web server.

For example, the client computer has a URL and looks up the host name part in DNS, which returns the IP. The computer then connects to the IP on the protocol-specific port and sends the HTTP request over that connection. The server then internally processes the URL from the HTTP request and returns the appropriate content.

Fls'Zen
  • 4,594
  • 1
  • 29
  • 37
1

The specific resource to access is given in the HTTP (in case of HTTP) request once you know the ip of the server.

Using the case in your example, a GET request would be something like this:

GET /questions/123 HTTP/1.1   <- Here you have the specific resource
Host: stackoverflow.com       <- Here you have the host

And the DNS transform the host stackoverflow.com to 123.12.12.12

Evans
  • 1,589
  • 1
  • 14
  • 25