[SOLVED] Fixing all DNS zones in the cluster

JIKOmetrix

Well-Known Member
Apr 3, 2007
183
34
178
Hello,

I have a issue that started with a DNS template. The DNS templaced had an include in the TXT for SPF that should not be there.

There are hundreds of DNS zones in the cluster. I do not want to manually edit each zone via the zone editor.

I have tried to do the following on each server in the cluster:
find /var/named -type f -print | xargs sed -i 's/include:example.net/ip4:123.456.789.123/g'

Then check:
grep -r "include:example.net" /var/named/*

Then restart named.

Then recheck:
grep -r "include:example.net" /var/named/*

I do this on all servers in the DNS cluster.

Even lookup a few public TXT records for zones that are effected. They look good.

Then, if I sync all zones to all servers even those not on this server, the zone entry "include:example.net" appears again in all zones on the server:
grep -r "include:example.net" /var/named/*

--

Not sure how to make this stick. Is there another location that DNS zones are held?

The process of find does look in cache folder and remove "include:example.net" from cache too.

It's like /var/named is not the master location for the DNS zones.

Can anyone point me in the right direction?

Thanks,
Mike
 
Last edited:

JIKOmetrix

Well-Known Member
Apr 3, 2007
183
34
178
Hello,

I have found my issue.

How to manually update a DNS Zone serial for a single domain or for all domains

So the process should be:
  1. find /var/named -type f -print | xargs sed -i 's/include:example.net/ip4:123.456.789.123/g'
  2. perl -pi -e 'if (/\s+(202\d{7})/i) { my $i = $1+1; s/$1/$i/; }' /var/named/*db
  3. rndc reload
  4. /scripts/dnscluster syncall

That fixed it up.

Done.