DNS Hosting with CNAME

c0nfus3d1

Verified User
Joined
Oct 29, 2010
Messages
15
I have domainA.com with this DNS Zone:

domainA.com. NS ns1.myname.com.
domainA.com. NS ns2.myname.com.
* CNAME domainB.com.

This works for all subdomains, but does not actually have anything set for the domain name itself. I try to add this:

domainA.com. CNAME domainB.com.​

I get this:

Unable to save dns zone: named-checkzone returned:
loading "domainA.com" from "/var/named/domainA.com.db.temp" class "IN"
dns_master_load: /var/named/domainA.com.db.temp:23: domainA.com: CNAME and other data
zone domainA.com/IN: loading from master file /var/named/domainA.com.db.temp failed: CNAME and other data
zone domainA.com/IN: not loaded due to errors.
 
That 'zone' is looking a bit bare..

I would expect to see an entry like:

domainA.com. A xxx.xxx.xxx.xxx (where xxx.. is the IPv4 of the hosting server)

Perhaps review of http://www.site-helper.com/dns.html and maybe other info there can help you get your site moving along.
 
The zone is supposed to be bare; the domain needs to point to another domain, not an IP address like you posted
 
Good luck with that. Seems like redirecting with .htaccess or from your registrar would do just as well.
 
OK, it may not be possible. I can accept that answer.

I can point any subdomain to another domain, but not the domain itself?
 
If you have both domain and the 2 ns all on your DA server you can do a lot of things and probably exactly what you wish. If that is the case, the DNS info presented via the DA Help link in my first post should prove useful. The large assortment of DNS checking websites can also help work things out.

It's unclear though if that is the situation.. or if you actually need to do that.

With regard to simply allowing the world to use either of two domain name to reach a single website the registrar is usually instantaneous and simple. You may also be able to use the registrar to forward email or provide free email for the redirected domain since this method allows you to retain the registrar DNS / NS services.

My registrar for instance can simply point any 'inactive' domains I have with them to any other domain or domain/directory, with a few options like iframe, url masking.

EG: forward nohostdomain to hosteddomain , hosteddomain/[dirname]

I don't think I can forward nohostdomain to sub.hosteddomain with my registrar but I may be mistaken. This would all be accomplished using the domain control panel at the registrar. I'd not have any record of nohostdomain on the DA server other than some log entries.

If you can only point the nohostdomain to a folder on hosteddomain then you can easily then redirect it to the main site index with http, php or .htaccess at the hosteddomain.

Bottom line, the full scope of your objective is not clear.
 
The reason the * is not providing correct resolution for the main domain is probably the same reason you get the error when you try the additional CNAME record. You cannot have any other records for the same domain as a CNAME record.

See this: http://stackoverflow.com/questions/656009/how-to-overcome-root-domain-cname-restrictions

and then maybe read further...

Have you tried using
Code:
example1.com CNAME example2.com
*.example1.com CNAME example2.com
in that order?

If that doesn't work then the issue is likely that you shouldn't be using CNAME for the main domain name at all.

If you can't find documentation I'd recommend finding the bind-users mailing list if it still exists and asking there.

Jeff
 
Back
Top