I created a bash script with this code in it, ran it, and it like deleted all the text in my .hosts files.
So I'm sitting here asking myself why didn't I backup in a test directory and run it...Oh no! I'm not sure how that could happen, but this post does pre-date the migration to Joomla, and so the formatting may have made something go terribly amiss...and, of course, there's now a command line tool to accomplish this same task. So, it's no longer necessary.
Here's the way to do it now (the path to the Webmin dir is different on different operating systems...this is RHEL/CentOS/Fedora):
| Code: |
cd /usr/libexec/webmin/virtual-server
sudo ./modify-dns.pl --all-domains --spf
|
You can also add other hosts, if you want using the "spf-add hostname" option.
As for your problem of losing all of your zones...I think one could do (I'm going to ask Jamie to check my work on this one, so wait until he confirms that this is non-dangerous):
| Code: |
sudo ./disable-feature.pl --all-domains --dns
sudo ./enable-feature.pl --all-domains --dns
|
Which I think will recreate the DNS zones for all of your domains. Of course, if you have domains that you
don't want to have DNS enabled, you'll probably need to get a bit more clever (or manually specify domains and run the command several times).
Again, on this last one, let's wait for Jamie to chime in with a sanity check to be sure I'm not telling you to do something stupid.