LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   cname save issues system-config-bind (https://www.linuxquestions.org/questions/linux-server-73/cname-save-issues-system-config-bind-868704/)

showe123 03-15-2011 08:42 AM

cname save issues system-config-bind
 
Hi-

Im new here to the forums and hopefully someone can help me with an issue...I'm trying to create a cname in system-config-bind. I can create the record but when I go to save it I get a "Zone file save error". Here's the full output:

Save of Zone file var/named/chroot/var/named/plantsareperfect.com.db failed
dns_master_load_/var/named/chroot/var/named/plantsareperfect.com.db:10:plantsareperfect.com:cname and other data (sorry, the rest is off the page and I cant see it)

Any ideas why I can't save this cname?

Thank you for any help.

jon2kx 03-15-2011 11:08 AM

Needs a zone file editor to save this information
 
You need to use a zone file editor to save this information, this most popular one is DNS-zone editor, free and open source :D

bathory 03-15-2011 05:02 PM

Hi,

This looks like a permissions problem.
Run:
Code:

ls -l /var/named/chroot/var/named/
to see if you write have permissions on the zone files.
Also check if it's SELinux that prevents writing in that directory

Regards

tallship 03-15-2011 11:41 PM

Or maybe you left off a period? What's happening on line 10?

When you cname, you've got fqdns on both sides, not just on one, or at least you have a hostname on the left and an fqdn on the right.

The hostname on the left side MUST have an A RR defined for it somewhere else in the zonefile (IOW, that host must be defined somewhere else in the zonefiles right side, with an A RR, if you will).

If you use an fqdn on the left, instead of the shorthand way of allowing BIND to append the zone by leaving out the trailing period, then make sure you use that period.

I'd start by looking there :)

I don't agree with a lot of Bernstein-isms, but I share his loathe of cname RRs and recommend that you just use A RRs instead.

If you wanna post the entire zonefile we might better be able to determine. Besides, as long as you don't restart named the old version of the zone will continue.

Hope that helps :)

.

showe123 03-16-2011 08:15 AM

Thanks for the feedback. I'm coming from a Mac OX Server background and I have extensive experience using DNS on that platform and what I noticed with BIND is, my A record points only to the domain name, not the machine name. In other words, in BIND, when you create an A record, it seems to only allow you to enter the domain name that is associated with the IP address, not the actual machine. In my example, I have a nameserver called vmware.plantsareperfect.com. Its my understanding that to define the IP that is associated with that machine you create an A record and point that IP to the machine. BIND doesn't seem to allow me to define the machine name. I do have the nameserver record created however.

I don't know if my Mac server background is causing my misunderstanding of DNS or what but it does seem to me that you can't create a cname until your A record points to a machine. What am I missing?

Thanks again for comments.

bathory 03-16-2011 08:58 AM

Quote:

Its my understanding that to define the IP that is associated with that machine you create an A record and point that IP to the machine. BIND doesn't seem to allow me to define the machine name. I do have the nameserver record created however.
It's not bind problem. I guess it's the system-config-bind tool that does not allow this action
You can edit the zone file by hand and use:
Code:

plantsareperfect.com. IN A x.x.x.x
vmware.plantsareperfect.com. IN A x.x.x.x


tallship 03-16-2011 07:14 PM

Quote:

Originally Posted by showe123 (Post 4292537)
I don't know if my Mac server background is causing my misunderstanding of DNS or what but it does seem to me that you can't create a cname until your A record points to a machine. What am I missing?

Thanks again for comments.

Again, I hate cnames, but you don't actually need an A RR in the zonefile if the cname points to a hostname outside the zone - i.e., another domain.

hm...

Well, for starters, follow bathory's model above and you should be fine (using A records instead of cname records). cnames just increase recursion unnecessarily and you can assign as many A RRs as you want to the same IP address anyway.

Now I don't even know how to copy a floppy on a Mac, and prolly never will, but there's a couple of things I can mention, expanding upon bathory's example of a well formed set of records.

first, don't forget those periods!

Second, you can use *shorthand*, if you like, which means that you could just put the hostname on the left with no period and then BIND will append the zone.

i.e.,:

Code:

vmware IN A x.x.x.x
Note there is no period. BIND will append the zone so that "vmware" is now "vmware.plantsareperfect.com." for you.

but if you do a

Code:

vmware.plantsareperfect.com IN A x.x.x
Then you're going to end up with the following hostname:

vmware.plantsareperfect.com.plantsareperfect.com.

When in doubt - do it longhand.

Third, if your nameserver is going to be in the same domain as the zone you're editing (Not the best approach), then you're going to need an NS RR as well as an A RR for the host that is the nameserver.

To be rfc compliant, there should be a glue record for the nameserver.

Finally, if you're nameserver is outside the zone - say, you use ns1.jomama.com, then all you need in this particular case is an NS record for the nameserver.

I hope that helps, Oh! and also... welcome to LQ :)


All times are GMT -5. The time now is 08:46 PM.