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.

  2. florian030

    florian030 Well-Known Member HowtoForge Supporter

    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 Well-Known Member Staff Member Howtoforge Staff

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

    Code: TXT "v=spf1 +a +mx -all" TXT "v=spf1 -all" TXT "v=spf1 -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