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.

WHM api 1 addzonerecord do not work when domain is not on same server

Discussion in 'cPanel Developers' started by kjg, Dec 31, 2015.

  1. kjg

    kjg Well-Known Member

    Joined:
    Mar 2, 2004
    Messages:
    147
    Likes Received:
    0
    Trophy Points:
    16
    Hi all,
    I am using the WHM API 1 to do a lot of things and was now also going to start using it for DNS changes instead of WHM API 0.
    Works fine as long as the domain is hosted (is an account) on the same server as the nameserver, but unfortunately that is not the case for us.
    We have a number of domains in our cPanel nameservers that are not hosted on same server as the nameserver.

    It works fine with addzonerecord in WHM API 0 but not in WHM API 1

    I get the following reply when trying to use addzonerecord with api.version = 1 :
    Code:
        [version] => 1
        [reason] => API failure: This system does not have a domain named “domainxyz.com”.
        [result] => 0
        [command] => addzonerecord
    
    The domain I test is in the nameserver on the server I am running the query on and dumpzone works fine in both WHM API 0 and WHM API 1, but addzonerecord works only in WHM API 0

    Any help on how to get around this odd limitation would be very much appreciated since I want to get rid of all old WHM API 0 calls.

    // kjg
     
    #1 kjg, Dec 31, 2015
    Last edited: Dec 31, 2015
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    To clarify, do you mean the domain name is added to the DNS cluster and the zone is in the /var/named directory, but there's no cPanel account for it on the local server?

    Thank you.
     
  3. kjg

    kjg Well-Known Member

    Joined:
    Mar 2, 2004
    Messages:
    147
    Likes Received:
    0
    Trophy Points:
    16
    Exactly. The domain name is in the nameserver (so it is in /var/named/thedomain.db) and can be edited via WHM Edit Zone functionality or via WHM API 0 but not via WHM API 1.

    There is no cPanel account for the domain on the local (nameserver) server.
     
  4. kjg

    kjg Well-Known Member

    Joined:
    Mar 2, 2004
    Messages:
    147
    Likes Received:
    0
    Trophy Points:
    16
    Just to update, the same problem exists also for getzonerecord and editzonerecord.
    They all give the same error when the domain is not an account on the server where the nameserver is located:
    Code:
    API failure: This system does not have a domain named “existingdomain.com”
    Can't find any way around this and really want to skip all API 0 calls when I rewrite a lot of stuff.

    Any suggestion would be very much appreciated

    // kjg
     
  5. kjg

    kjg Well-Known Member

    Joined:
    Mar 2, 2004
    Messages:
    147
    Likes Received:
    0
    Trophy Points:
    16
    Hi Michael
    Can you confirm this?
    Is it a bug that I should report, or is it just me ...

    Thank you.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Upon further investigation, this behavior is by design. Allowing this behavior is considered a security flaw because it would permit unauthorized zone modifications. CPANEL-2323 is open to determine the best method of restoring this behavior.

    Thank you.
     
Loading...

Share This Page