Anyone have a api script to update a particular DNS record for all domains?

Discussion in 'Tips/Tricks/Mods' started by webguyz, Jan 30, 2016.

  1. webguyz

    webguyz Active Member HowtoForge Supporter

    We recently changed our mail relay company and now have to update the SPF record of all our domains. Was wondering if anyone had such a script because they ran into the same thing so I would not be re-inventing the wheel.

    If not will have to examine into the dns import script to get some ideas.

    Thanks!
     
  2. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    I do this in mysql and run the resync-tool afterwards.
    UPDATE dns_rr SET data = "new spf" WHERE (data = "old spf" AND type = "TXT");
     
    DDArt likes this.
  3. webguyz

    webguyz Active Member HowtoForge Supporter

    Simple and elegant. Thank you!
     
  4. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Consider maintaining a single SPF record for your hosting company which you include: in all your client domains. Something like:

    Code:
    spf.yourdomain.com TXT "v=spf1 +a +mx +a:mail.yourcompany.com +a:webmail.yourcompany.com +a:web1.yourcompany.com +a:web2.yourcompany.com include:mail.relay.company -all"
    
    yourcompany.com TXT "v=spf1 +a:www.yourcompany.com include:spf.yourcompany.com -all"
    
    yourclient.com TXT "v=spf1 +a:www.yourclient.com include:spf.yourcompany.com -all"
    You then have a single place to add all your web/mail servers as you grow, and changes to your mail relay provider are simple.
     
    Last edited: Feb 9, 2016
  5. webguyz

    webguyz Active Member HowtoForge Supporter

    Neat idea. Thanks!
     

Share This Page