Mailsecure: Difference between revisions
Jump to navigation
Jump to search
Created page with " Make domain list(put the domains the want in here) vim /root/mailsecurelist Run this for loop to use the domain list to backup each domains zone file, then remove the old..." |
No edit summary |
||
Line 5: | Line 5: | ||
Run this for loop to use the domain list to backup each domains zone file, then remove the old mx entries, and add the new ones as well as update the ttls and serials all at once. | Run this for loop to use the domain list to backup each domains zone file, then remove the old mx entries, and add the new ones as well as update the ttls and serials all at once. | ||
for i in `cat mailsecurelist`; do sed -i.lwbak -e '/IN[[:space:]]*MX/d' /var/named/$i.db; echo "$i. 300 IN MX 0 bmx01.sourcedns.com." >> /var/named/$i.db; echo "$i. 300 IN MX 0 bmx02.sourcedns.com." >> /var/named/$i.db; sed -i -e 's/^\$TTL.*/$TTL 300/g' -e 's/[0-9]\{10\}/'`date +%Y%m%d%H`'/g' /var/named/$i.db; done | <pre>for i in `cat mailsecurelist`; do sed -i.lwbak -e '/IN[[:space:]]*MX/d' /var/named/$i.db; echo "$i. 300 IN MX 0 bmx01.sourcedns.com." >> /var/named/$i.db; echo "$i. 300 IN MX 0 bmx02.sourcedns.com." >> /var/named/$i.db; sed -i -e 's/^\$TTL.*/$TTL 300/g' -e 's/[0-9]\{10\}/'`date +%Y%m%d%H`'/g' /var/named/$i.db; done | ||
</pre> | |||
test work | test work | ||
for i in `cat /root/mailsecurelist`; do egrep 'IN[[:space:]]*MX' /var/named/$i.db; done | for i in `cat /root/mailsecurelist`; do egrep 'IN[[:space:]]*MX' /var/named/$i.db; done |
Revision as of 23:15, 25 October 2015
Make domain list(put the domains the want in here)
vim /root/mailsecurelist
Run this for loop to use the domain list to backup each domains zone file, then remove the old mx entries, and add the new ones as well as update the ttls and serials all at once.
for i in `cat mailsecurelist`; do sed -i.lwbak -e '/IN[[:space:]]*MX/d' /var/named/$i.db; echo "$i. 300 IN MX 0 bmx01.sourcedns.com." >> /var/named/$i.db; echo "$i. 300 IN MX 0 bmx02.sourcedns.com." >> /var/named/$i.db; sed -i -e 's/^\$TTL.*/$TTL 300/g' -e 's/[0-9]\{10\}/'`date +%Y%m%d%H`'/g' /var/named/$i.db; done
test work
for i in `cat /root/mailsecurelist`; do egrep 'INspace:*MX' /var/named/$i.db; done
Reload name server.
rndc reload