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.
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.