13

Is it posssible for me to use CNAME for different domains like

www.domain2.com CNAME www.domain1.com

Both are server from same server but different Virtual host (root paths are different)

Balaji
  • 859
  • 1
  • 16
  • 27

2 Answers2

15

Yes, it is valid for a CNAME to point to an entirely different domain. This is often used in the context of using CNAME records to handle the TLD variants on your domain such as:

mydomain.com CNAME mydomain.net.
davidethell
  • 11,708
  • 6
  • 43
  • 63
  • 5
    You should not CNAME whole domain, see http://stackoverflow.com/a/757972/196206 or http://serverfault.com/q/430970/80856 – Messa Aug 19 '14 at 11:08
0

It is possible to do this at the DNS level, but that effectively means that both domains point to the same resource. If you have 2 different applications serving different content, than this is not the case.

cdeszaq
  • 30,869
  • 25
  • 117
  • 173