The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Update all zones with dmarc record

Discussion in 'Workarounds and Optimization' started by samuelmf, Jun 10, 2016.

Tags:
  1. samuelmf

    samuelmf Well-Known Member

    Joined:
    May 22, 2006
    Messages:
    80
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    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
     
  2. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    275
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    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:dmarc@$(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:dmarc@%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
     
  3. samuelmf

    samuelmf Well-Known Member

    Joined:
    May 22, 2006
    Messages:
    80
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    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:dmarc@%domain%;"
    instead use dmarc@%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"
     
  4. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    275
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    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.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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!
     
Loading...

Share This Page