1

I have three unique domains. Let's call them domain1.example, domain2.example and domain3.example. They all need to go to the same website, which I am serving with domain1.example.

Can I just create CNAME records like this?

domain2.example    CNAME    domain1.example
domain3.example    CNAME    domain1.example

Or do CNAMEs only work for subdomains (i.e. www.domain2.example)?

3
  • I am not running mail or any other services with domain2.com or domain3.com.
    – JWS15
    Sep 3 '15 at 22:14
  • Presumably you still want to have domain2 and domain3 in the address bar? Are you using name-based Virtual Hosts (ie. a shared server)? In which case, setting a CNAME record isn't the only thing you'll need to do.
    – MrWhite
    Sep 3 '15 at 23:45
  • CNAME can not exist at apex, so you can say they work only for subdomains. Jul 3 '20 at 22:35
2

Yes. You can do this.

For domain 1, you should have an A record that points an IP address to domain1.example. That is a given.

For domain 2 & 3, you can use a CNAME to point domain2.example to domain1.example and domain3.example to domain1.example.

You may also need to use a CNAME for any www version of any site. The process is the same. You would point www.domain1.example to domain1.example and point www.domain2.example to domain1.example and www.domain3.example to domain1.example.

Just know that there may be an issue with duplicate content. To avoid this, you would use a canonical tag to correct this.

You can find more information than you want at: https://support.google.com/webmasters/answer/139066?hl=en ,however, example code for what you need exists under the header Indicate the preferred URL with the rel="canonical" link element. With this code, you would be pointing your content page to itself using the domain 1 domain name.

1
  • "Yes. You can do this." No, you can't do this with CNAME records as asked by OP because you can not have a CNAME record at the apex since the CNAME can not coexist with any other record , and apex obviously always have NS and SOA records, so you can NOT do example.com. CNAME example.net.. Various providers have specific local proprietary solutions to basically do the above, often called ALIAS or ANAME or TARGET or whatever else. They are however not standardized. You can have a CNAME on www of course. Jul 3 '20 at 22:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.