0

I'm trying to map somedomain.com to here.anotherdomain.com. I can do any sub domains of the original using a CNAME but the root domain ( somedomain.com ) needs an A record. This is currently set to the ip address of the server ( anotherdomain.com ).

My question is, do I add a CNAME record of somedomain.com to point to here.anotherdomain.com on the server DNS zones?

NAMESERVER RECORDS
A somedomain.com 123.123.123.123
CNAME www here.anotherdomain.com

SERVER RECORDS
CNAME somedomain.com here.anotherdomain.com

The nameservers are at codeigniter and the server is cPanel.

Thanks for any help

Joe

jhodgson4
  • 111

3 Answers3

1

The DNS spec, RFC 1035, does not for the 'naked domain' (domain.com) to have CNAME's. More technically, it states that a CNAME must be alone, so you can't have both CNAME's and NS's (and other records required for a domain to work).

Cloudflare went ahead and tried to handle this on their end, by allowing a CNAME as the root record, whereafter they will resolve it and present an A record to the end-user. You can use Cloudflare for their DNS service only, if you so wish - so that's always an option.

Source: http://blog.cloudflare.com/introducing-cname-flattening-rfc-compliant-cnames-at-a-domains-root/

1

Just put both somedomain.com and here.anotherdomain.com to the same ip address, create a vhost for here.anotherdomain.com and no vhost for your somedomain.com
or
put both in the same vhost enter somedomain.com and here.somedomain.com then make a rewright to your apache to your default domain here.anotherdomain.com.

Dimitrios
  • 119
0

I'm puzzled, because somedomain.com doesn't need a A record. See for example the records for fdn.fr and www.fdn.fr. If your DNS provder require a A record for somedomain.com, you should put a HTTP redirect or something like that behind.

Yes you should add a CNAME record. If you really want users to connect to here.anotherdomain.com you should consider redirection mechanism at higher protocol level (e.g. HTTP 301 redirect)

Manu H
  • 158