Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    102
    Likes Received:
    4
    Trophy Points:
    168
    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:
    702
    Likes Received:
    113
    Trophy Points:
    168
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. samuelmf

    samuelmf Well-Known Member

    Joined:
    May 22, 2006
    Messages:
    102
    Likes Received:
    4
    Trophy Points:
    168
    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:
    702
    Likes Received:
    113
    Trophy Points:
    168
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,791
    Trophy Points:
    363
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice