Wed Oct 7 13:28:22 EEST 2009

DNS domains expiry problems and their fix

Already for a week the company I'm employed at is missing their
primary DNS server, because the server on which it runs has failed. This is meek to say ridiculous, however this is another topic of conversation.
As a result of all this mess today many domains stopped resolving
because the DNS entries in the DNS cache has expired
(default they are kept for 1 week).
Logically the fix to this shitty problem comes to changing the default
cache to be stored for more than 1 week. Thus I've changed that
default cache expiry with a little bash expression, here is
the expression itself:
# here comes your directory with zone files
cd /var/cache/bind
# 604800 is 1 week in seconds it's substituted recursively to 3024000 (5 weeks)
for i in *; do perl -pi -e 's/604800/3024000/g' $i; done

This solves the issue temporary, anyways being without a primary DNS server for so long ain't a good idea at all.