How IP divides to point sub domains [closed]
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the q开发者_如何学编程uestion may be able to be answered.
Closed 6 years ago.
Improve this questionI believe that default domain some www.domain.com
points to some IP address 123.123.123.123
here when a sub domain is created which points to the same IP address. How the division of IP address works in real time to distribute IP to various sub domains. Do it uses port numbers to each sub domain? or any other method?
The root DNS server contains an entry called an NS record which indicates for each domain which server to query to resolve names in that domain. That server in turn may further redirect ("delegate") queries for individual subdomains. Read about the DNS e.g. at Wikipedia.
It sounds like you're asking how a webserver distinguishes between www.domain.com and something.domain.com when both are on the same ip address? It's done by the webserver - Apache uses VirtualHost
configuration entries to distinguish based on a combination of IP address and the domain in the http URL.
You can read more about it here: http://httpd.apache.org/docs/2.0/vhosts/name-based.html
精彩评论