Hello,
There isn't an easy way to do this.
If I had to do it, I would create a script to do it for me.
eg, fix.sh:
Code:
#!/bin/sh
DIR=/var/named
IP=[b]1.2.3.4[/b]
for i in `cat /etc/virtual/domains`; do
{
FILE=$DIR/${domain}.db
echo "Creating DB file for ${domain} in ${FILE}";
echo "\$TTL 14400" > $FILE;
echo "@ IN SOA ns1.${domain}. root.${domain}. (" >> $FILE;
echo " 2007051103" >> $FILE;
echo " 14400" >> $FILE;
echo " 3600" >> $FILE;
echo " 1209600" >> $FILE;
echo " 1209600" >> $FILE;
echo " 86400 )" >> $FILE;
echo "${domain}. 14400 IN NS ns1.${domain}." >> $FILE;
echo "${domain}. 14400 IN NS ns2.${domain}." >> $FILE;
echo "* 14400 IN A $IP" >> $FILE;
echo "${domain}. 14400 IN MX 10 mail.${domain}." >> $FILE;
};
done;
Put that into a file, save the file, chmod the file to 755, then run it.
It will create all zones from scratch.
If you've already fixed some manually, back them up and restore them after, because.. it will overwrite them.
This is a very basic zone that uses a wildcard for A records, so will get things going quicker, but you may want to swap the records back to normal ones. (eg, remove the * and replace with www, pop, ftp, mail, smtp, subdomains, etc)
Replace
1.2.3.4 with the IP of your domains.
If you have domains on different IPs, then you'll have to tweak them manually.
John