mv /etc/bind/named.conf.local /etc/bind/named.conf.local.orig find /etc/bind -name "*hosts" | sort -u | grep -vf <(grep zone /etc/bind/named.conf.orig | xargs -n1 | sort -u) | while read file do cat << EOF zone "$file" { type master; file "/etc/bind/fastdoublers.com.hosts"; }; EOF done >> /etc/bind/named.conf.local