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.

SOLVED whm api1 editzonerecord issue

Discussion in 'cPanel Developers' started by yuncheng, Feb 21, 2017.

Tags:
  1. yuncheng

    yuncheng Registered

    Joined:
    Feb 21, 2017
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Singapore
    cPanel Access Level:
    Root Administrator
    Hi, I try to edit the DNS zone using the whm api1 but out of luck. I'm trying to modify the srv record.

    editzonerecord?api.version=1&domain=abc.com&name=_srv2.abc.com.&class=IN&ttl=86400&type=SRV&priority=3&weight=5&port=422&target=eeeeee.com&line=27

    If line 27 is a SRV dns record, it returns:
    ["metadata"]=> object(stdClass)#55 (4) { ["version"]=> int(1) ["command"]=> string(14) "editzonerecord" ["reason"]=> string(58) "Bind reloading on server using rndc zone: [snappyhost.my] " ["result"]=> int(1) }

    But only name field is changed. the priority weight port and target all remain same. Anyone knows what happens?

    If line 27 is not a SRV dns record but a other type record, it returns:
    ["metadata"]=> object(stdClass)#55 (4) { ["version"]=> int(1) ["reason"]=> string(61) "Invalid DNS record: Supplied target for SRV record is invalid" ["result"]=> int(0) ["command"]=> string(14) "editzonerecord" }

    From the official document I can't find any useful information about this. Really confused. Can editzonerecord work if i want to change it to another type dns record? From what i tested, seems can't
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello @yuncheng,

    Internal case CPANEL-11328 is open to address an issue where it's not possible to change the "target" of the SRV field when using the editzonerecord WHM API 1 call. I'll update this thread with more information on the status of this case as it becomes available. In the meantime, you will need to edit the zone file directly via the command line as a workaround.

    Thank you.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    To update, this is fixed in cPanel version 64:

    Fixed case CPANEL-11328: Ensure WHM API editzonerecord call can edit SRV records.

    Thank you.
     
Loading...

Share This Page