Web-server – One domain, two hosts, multiple subdomains on second host

domain-name-systemhostingsubdomainweb-server

So here's the deal:

  • 1 domain (example.com)
  • 2 shared hosting plans (for each, all domains and subdomains have the same IP address)

I've already set up sub1.example.com to point to the IP (using A) of the second host and it works.

Now what if I want to point sub2.example.com to the same host, but different folder? I can't point to the same IP. Is there a way around it? Or do I have to get dedicated IPs for each subdomain on the second host?

Best Answer

DNS translates hostnames to IPs, there is no such thing as a different folder DNS-wise. The translation hostname (or more generally: URL) to folder must be done in your webserver configuration. This is called virtual hosting. (Some problems arise if you need https for several names)

Related Topic