• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

DNS question.

kekie

Junior Member
So, as I understand things, when I connect to www.google.com, my browser first initiates a connection to a DNS server and says "what's the IP associated with www.google.com?" Then the DNS server responds with `216.58.216.4` or whatever. Then my browser connects to 216.58.216.4 (or something), and all is well.

My confusion arises when I try to connect to a webserver, and it only lets me in when I use their domain name, and not when I type in their IP. How does the server know that I didn't contact a DNS server?

Also, when two domain names 1.example.com and 2.example.com resolve to the same IP address, but otherwise identical URLS will yield different pages. i.e., 1.example.com/whatever is different from 2.example.com/whatever, despite 1.example.com and 2.example.com resolving to the same address.
 
That's because most web server's store multiple websites. Most of the time, you can't access access a web server directly by IP address. The target hostname is transmitted to the web server when you make an http request to that server, so it knows what website subdirectory to point you to.
 
Your second question is the same answer. The hostname determines what website you're trying to access. www.example.com, www1.example.com and www.example.net may all be located on the same physical server, using different subdirectory' and accounts. When you type www.example.com in your browser, it sends that request to the specific web server who then points you to that account's directory on the server. You usually cannot pull up a general website by IP address anymore. You used to be able to about 15 years ago but that's not usually possible anymore, especially with the IPv4 shortage.
 
Back
Top