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.

Adding NS records and SOA records

Discussion in 'Bind / DNS / Nameserver Issues' started by nickrucci, Oct 14, 2016.

Tags:
  1. nickrucci

    nickrucci Registered

    Joined:
    Oct 14, 2016
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Utah
    cPanel Access Level:
    Root Administrator
    I am wanting to add NS records and SOA records but cPanel doesn't give me the option to add those through the interface. I see from the API that I can add a record via https://server:2083/cpsessxxxxxxxxxxx/json-api/addzonerecord?api.version=1. I only want to add the records I want to once and leave it alone. I figured I can do this through Postman. I am wanting to POST to the URL above with the following body:

    Code:
    {
        "domain": "domain",
        "name": "name",
        "class": "IN",
        "type": "NS",
        "nsdname": "thing"
    }
    I set up a Basic Auth header. I try to POST and I receive a

    Code:
    {"cpanelresult":{"apiversion":"2","error":"Token denied","data":{"reason":"Token denied","result":"0"},"type":"text"}}
    Do I not have the correct URL to POST to?
    Why is it returning apiversion 2 when I specified 1?
    Do I need to use something other than Basic Auth?
    Can I generate a token another way than using Basic Auth?
    Can I do this without Postman and configure something in the cPanel interface so that I can add NS and SOA records?
    Any help would be great.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Support for NS and SOA record manipulation through cPanel or cPanel UAPI/API 2 functions is not currently offered. I encourage you to open a feature request for the ability to modify the "NS" records, and vote/add feedback to the following feature request:

    Move SOA record management to Advanced Zone Editor

    Do you have root access to the system? If so, the following WHM API 1 function would allow you to make these modifications:

    WHM API 1 Functions - editzonerecord - Software Development Kit - cPanel Documentation

    Thank you.
     
Loading...

Share This Page