Domain DNS management problems

alexo

Verified User
Joined
Mar 15, 2007
Messages
29
Hello

Need to add this 2 lines for domain via DirectAdmin ->"DNS Management" section

wap.domain.com. CNAME modhi.domain.org
domain.com. CNAME modhi.domain.org


First line i add w/o any problem, but when i try to add the second one i got an error

Quote:
Error Writing Records

Details

Unable to save dns zone: named-zonecheck returned:
loading "domain.com" from "/var/named/domain.com.db.temp" class "IN"
dns_master_load: /var/named/domain.com.db.temp:28: domain.com: CNAME and other data
dns_master_load: /var/named/domain.com.db.temp:28: domain.com: CNAME and other data
dns_master_load: /var/named/domain.com.db.temp:33: domain.com: CNAME and other data
zone domain.com/IN: loading master file /var/named/domain.com.db.temp: CNAME and other data

What i'm doing wrong?

thank you
 
Hi,

I suppose you are adding these to domain.com ?

You have to fill in "wap" as name and "modhi.domain.org." as CNAME (no . after wap, but a . after domain.org)
for domain.com you do need to use "domain.com." as name ans "modhi.domain.org." as CNAME. (both have a . after the text).

let me know if this fixes it.

regards,
Stijn
 
I'm doing as you told, both with "." after text - no success -> the same error.
 
Hi,

Just tried it. you are right. domain.com. isn't working. the wap is working though.

After searching a bit it seems having a cname on your main domain isn't really a good practice.
Why are you trying to do this?

Stijn
 
it's my customer's site and after moving to my server he asked me to setup this dns settings for his domain.

As He told this DNS records works on previous server (cpanel).
 
Rule is that if you have a CNAME for a resource, pointing it elsewhere, then all other records for that resource are ignored. Normally you should never use a CNAME record to point to anything you already own; CNAME records should be used only when you don't know if/when an IP# may change so you use a CNAME record to automatically get the most up-to-date IP# each time.

Jeff
 
Rule is that if you have a CNAME for a resource, pointing it elsewhere, then all other records for that resource are ignored.
I cann't add this or all other records will be ignored?

Why i ask this, as the only records that this customer need from me, is this 2 lines. Nothing else. They don't going to have/keep any files on my server. Just to redirect in this way (i don't understand what is the difference of such redirection from 301 permanent redirection, but i must repeat, that all they need from me is this 2 lines)/


wap.domain.com. CNAME modhi.domain.org
domain.com. CNAME modhi.domain.org


nobaloney

does this rule related to DA? why i ask, as because as they claim, this dns settings works well on cpanel hosting.


thank you very much
 
I can't add this or all other records will be ignored?
Turns out I was wrong; the zone is skipped and not loaded if the zone file has a CNAME data record in it; you can only use CNAME for subdomains and services (i.e., sub.domain.com and service.domain.com) but not for the canonical name domain.com, in the zone file for domain.com. If you do, the zone file isn't even loaded into BIND.

DirectAdmin prechecks this for you before saving the changes and reloading BIND and that's why it shows you the error. If it didn't, you'd think the zone was working but it wouldn't be.

I tested on a server running BIND 9.2.4, but not running DirectAdmin, and I checked the logs. The logs show the error: CNAME and other data.
Why i ask this, as the only records that this customer need from me, is this 2 lines. Nothing else. They don't going to have/keep any files on my server. Just to redirect in this way (i don't understand what is the difference of such redirection from 301 permanent redirection, but i must repeat, that all they need from me is this 2 lines)
Which break the zone, and if DirectAdmin didn't give you the error, then BIND would log the error and skip the zone. Really. I just tested. A permanent redirection works because it has nothing to do with DNS, so DNS limitations don't affect it. Another way to do it would be to, instead of using CNAME, use an A record for modhi.domain.org. Of course this means that if mohdi.domain.org ever changes it's IP#, the A record won't work.
does this rule related to DA? why i ask, as because as they claim, this dns settings works well on cpanel hosting.
I don't know how it could work on cPanel. Does cPanel use BIND? It's a limitation built into BIND (simply google CNAME and other data for more information).

Jeff
 
A CNAME-record cannot exist with any other records for the same name, because a name cannot both be an alias (CNAME) and something else at the same time.

From RFC1912 section 2.4:
"A CNAME record is not allowed to coexist with any other data."

If you try to create a CNAME-record for the name of the zone itself, you will always encounter this conflict because a zone always has at least a SOA-record and typically one or more NS-records with the zone name

Related to http://www.rfc-editor.org/rfc/rfc1912.txt
 
Sorry to open such an old thread, but I think this is the best place to post.

I am using cloudflare for one of my domains and I want to add img1, img2 as CNAME, or A (the idea is that is should point to the main domain), but what it does is really strange: img1.site.com goes to mainSiteOnServer.com (the one with the dedicated IP).
I've tried CNAME and A, it does the same thing.

Does anyone know how to fix this, please? Or can anyone explain why this happens?
Thank you.
 
Hello,

You should first add img1, img2 as subdomains into Directadmin. This is needed in order to get valid virtualhosts in Apache with a desired document root. As soon as you finish creating sub-domains you should adjust DNS records for them.
 
Back
Top