Question

Apache doc regarding virtual hosts states:

Your server has a single IP address, and multiple aliases (CNAMES) point to this machine in DNS. You want to run a web server for www.example.com and www.example.org on this machine.

Am I right to assume that I can also bind two domains to this single IP address using A DNS records, instead of creating one A record and CNAME record for another domain pointing to the first domain? I mean that it won't affect Apache's functionality.

Was it helpful?

Solution

Correct. The browser passes the name it is requesting. It does not care what type of DNS record was used to resolve the name to an ip address.

I usually use Cnames though for the actual domain. and point it at an a record that just represents the ip. Just a way to organize things and make it easier in the future.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top