-3

A server can host multiple websites.

For example let the server'S IP be 111.222.333.444

Then one website could reside at 11.222.333.444/example1 and another at 11.222.333.444/example2 directory

If you dig the a DNS record of those two, you will always get the servers ip. E.g

root@ubuntu:~$ dig +short -t a example1.com
111.222.333.444

Hence, I am wondering. How does the browser know exactly where to point? Is there another DNS record that specifies the URL's path?

3
  • 111.222.333.444 is not an IP address. Oct 3, 2020 at 21:30
  • Apparently it's not, I just used it for the example's shake
    – HelloWorld
    Oct 3, 2020 at 23:04
  • 1
    IP addresses are put aside for example use, see RFC 5737. You can use 192.0.2.0/24 Oct 4, 2020 at 2:10

2 Answers 2

2

This has nothing to do with DNS or browser. This is strictly web server configuration.

Browser uses "Host:" header specifying the NAME of the the website which it wants to get and the rest is up to web server to get the correct content.

0
1

Then one website could reside at 11.222.333.444/example1 and another at 11.222.333.444/example2 directory

Nope. There is ONE website, residing at 11.222.333.444 - what you put into this website, including folder with "fake" other sites, is not a DNS issue.

BUt you rquestion also mixes this up - the 2 websites would be on the same address, but NOT IN FOLDERS and UNDER DIFFERENT DOMAINS.

And the last is important because the different domains return different content based on the domain. Which the browser SENDS IN THE HTTP REQUEST. It TELLS The server which domain it wants to reach.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .