Author Topic: DNS CNAMES  (Read 5398 times)

jbolthouse

  • Zen Apprentice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
DNS CNAMES
« on: April 15, 2011, 03:16:59 am »
I have some TL CNAMES that I need to replicate on my local DNS to resolve some telephony issues. I am able to get the configuration to work in the local DNS by manually editing named.conf.local in the bind folder, but when I make changes on the admin web site, they overwrite my configuration..

Is there any way to enter the CNAME entries and have them persist reboots and reloads of the configs?

sixstone

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1417
  • Karma: +26/-0
    • View Profile
    • Sixstone's blog
Re: DNS CNAMES
« Reply #1 on: April 15, 2011, 12:08:17 pm »
Hi there,

There is currently just one way of doing this by adding a new domain, setting the hostnames and then the alias.

What do you exactly want to do?

Best regards,
My secret is my silence...

jbolthouse

  • Zen Apprentice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: DNS CNAMES
« Reply #2 on: April 15, 2011, 03:27:13 pm »
OK... I think i finally got it after a few Diet Cokes and a lot of finagling.

Essentially, I created the zone (thedomain.suff) in the manager, and saved the config changes. This wrote db.thedomain.suff to the /etc/bind directory. I then removed the domain from the configuration in ebox (zentyal). This leaves you with the db.thedomain.suff file in your bind directory, which you will need in a moment.

I took its zone file from named.conf.local:
Code: [Select]
zone "thedomain.suff" {
        type master;
        file "/etc/bind/db.thedomain.suff";
};

and copied it into /usr/share/ebox/stubs/dns/named.conf.local.mas
at the very bottom of the file.

I restarted the DNS  with /etc/init.d/bind9 restart

and the zone configuration properly copied to my named.conf.local

After that, I simply edited the db file in the /etc/bind directory and restarted appropriately.


jbolthouse

  • Zen Apprentice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: sixstone
« Reply #3 on: April 15, 2011, 03:35:54 pm »
Sixstone,

I have a Asterisk box running locally. I wanted to set my phones to access vox1.thedomain.suff, and if they were local or VPN'd in, they would get the local IP and avoid NAT. If they were public-side, then they would have to jump through the firewall. Either way I would be preserving the host-name.

thedomain.suff is a top-level DNS record with a registrar/DNS group...  When I would create the zone locally, all thedomain.suff hostnames attempted to resolve on the local DNS (Zentyal). That worked great for the phones, as that hostname was entered in Zentyal. I could have replicated the rest of the DNS zone from my TL DNS, IP Address for IP Address, but the problem came when I came to CNAMES.

On my top-level, I have some funky redirecting happening for Google's apps for domain. This means that I have some names like mail.thedomain.suff mapped with a CNAME entry to ghs.google.com. I needed to build that into BIND on the local side, so that resolution would still happen.

I think I have it working now, but I am a little fearful that a reboot or reload of configs will wipe it out again.. when I have a few free minutes I will BAK everything and try some various reloads and reconfigs.

sixstone

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1417
  • Karma: +26/-0
    • View Profile
    • Sixstone's blog
Re: DNS CNAMES
« Reply #4 on: April 17, 2011, 03:12:44 pm »
Hi there,

The main problem here is your changes will be overwritten in the software upgrades of ebox-dns package.

I'd suggest you to read this post [1] regarding to user's modifications in Zentyal.

Best regards,

[1] http://blogs.zentyal.org/jacalvo/2011/01/04/how-to-customize-the-configuration-files-generated-by-zentyal/
My secret is my silence...