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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

API - DNS - Add / modify multiple records

Discussion in 'cPanel Developers' started by bouvrie, Feb 23, 2018.

  1. bouvrie

    bouvrie Active Member

    Apr 6, 2012
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Hi, I'm looking for a means of adding and/or modifying multiple DNS records for a single domain in one go, via a WHM API. Domains in the DNS have no relation to a WHM user.

    When using multiple "editzonerecord" API calls, the SOA serial is +1'ed at every request and I have to juggle with line numbers when changing and removing multiple records in one go...

    How can I achieve a DNS zone modification in a transaction of some sort?
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

    We document how to use this WHM API 1 function at:

    WHM API 1 Functions - editzonerecord - Developer Documentation - cPanel Documentation

    Using the dumpzone function and line numbers is the most effective way to use this API function, as noted:

    Otherwise, an alternative would be to manually modify the zone file directly via the command line (/var/named/$domain.tld.db) outside of the API.

    Thank you.

Share This Page