samuelmf

Well-Known Member
May 22, 2006
126
6
168
Perú
How can i do to bulk update the zones on my server to avoid edit one by one?

Additionaly how cand i set on the Zone templates the option to add dmarc register, automatically to new accounts.

Thanks
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
157
168
New Jersey
cPanel Access Level
DataCenter Provider
You could do a echo like

Code:
# cd /var/named ; for i in `ls -I . -I .. *.db` ; do echo "_dmarc IN TXT \"v=DMARC1; p=reject; rua=mailto:[email protected]$(echo $i | sed 's/.db//g');\"" >> $i ; done
That's a strict dmarc though so you may want to change it, just using it as an example. You also have to bump the serial up in the dns zone.

Code:
# find /var/named/*.db -mtime -1 -exec perl -pi -e 'if (/^\s+(\d{10})\s+;\s+serial/i) { my $i = $1+1; s/$1/$i/;}' '{}' \;
You may also want to backup your DNS zones prior as well:

Code:
# cp -a /var/named /var/named-bk
As far as the template, in WHM: Home »DNS Functions »Edit Zone Templates

You could add this to the standard template:

Code:
_dmarc IN TXT "v=DMARC1; p=reject; rua=mailto:[email protected]%domain%;"
Again, just as an example, you may want to change the actual record.

Oh and don't forget to reload the zones after doing so:

Code:
# service named reload
 
  • Like
Reactions: hiredgeek

samuelmf

Well-Known Member
May 22, 2006
126
6
168
Perú
Thanks for reply my friend a dude

As far as the template, in WHM: Home »DNS Functions »Edit Zone Templates

You could add this to the standard template:
Code:
_dmarc IN TXT "v=DMARC1; p=reject; rua=mailto:[email protected]%domain%;"
instead use [email protected]%domain% as mail can i use a gmail account for all the accounts? the same thing for the email on the echo code.

And after all that is neccesary that i use the option "Synchronize DNS Records"
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
157
168
New Jersey
cPanel Access Level
DataCenter Provider
You can but requires more since the domain would differ from the domain within the zone, read this:

HOWTO - Define a DMARC Record search for the rua= section

As far as running "Synchronize DNS Records" no its not needed unless you are running a DNS cluster which it doesn't sound like you are. After you modify the DNS zones, when you run 'service named reload' this will reload all the DNS zones and nothing further is required.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,908
2,216
463
Hello,

Note that a feature request for DMARC support is open at the following URL:

DMARC config in email authentication section

Please feel free to vote and add feedback to this request if you would like to see official support for DMARC records integrated into cPanel.

Thanks!