View Single Post
Old 2nd March 2006, 06:07
Switched Switched is offline
Junior Member
Join Date: Mar 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

Nice work!

May I suggest a small improvement?

In your dupcheck function you use this

chop($dupcheck = `grep -ic $domain /var/named/named.conf`);

The problem with that is it matches too much. For example, as a webhost I find my users will often get their country specific domain, and the .com. So, if they start with and later add, your test will fail when it really shouldn't.

Looking at the structure of a secondary zone entry, we should be able to match the first line uniquely.


zone "" {
        type slave;
        file "/path/to/zones/";
        masters {; };
should make

chop($dupcheck = `grep -ic "zone \"$domain\" {" /var/named/named.conf`);

Cheers! And thanks again for posting all of that.
Reply With Quote