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!

WHMAPI1 dumpzone not returning actual record

Discussion in 'cPanel Developers' started by bouvrie, Oct 4, 2018.

  1. bouvrie

    bouvrie Active Member

    Joined:
    Apr 6, 2012
    Messages:
    37
    Likes Received:
    6
    Trophy Points:
    58
    cPanel Access Level:
    Root Administrator
    Hi,

    I want to use the WHM API to get a list of all DNS records on my server. The 'dumpzone' function seems to be the function to use, but I have two issues with it:

    1. depending on the type of the DNS record, the function returns a different data structure (typed). Isn't it possible to get a RAW line of the actual data stored in the DNS record, so I don't have to reverse-engineer regenerate cPanel's interpretation of the record?

    2. Related to #1, cPanel's interpretation of some record(s) is false. For example, given the following DNS record:
    Code:
    mydomain.            14399   IN      LOC     51 30 12.748 N 0 7 39.612 W 52.00m 10m 10m 10m
    Then cPanel's API will return:
    Code:
    [size] => 1000
    [latitude] => 2332896396  <-- huh?
    [longitude] => 2147024036  <-- huh?
    [ttl] => 14400
    [class] => IN
    [Line] => 18
    [horiz_pre] => 1000
    [version] => 0
    [altitude] => 10005200
    [vert_pre] => 1000
    [name] => mydomain.
    [type] => LOC
    As you can see, fields latitude and longitude are NOT returned par the API specs at WHM API 1 Functions - dumpzone - Developer Documentation - cPanel Documentation (LOC record), which says they should look like "51 30 12.748 N".


    Bottom line: for me to fulfill my request, even if I would painstakingly implement support for all various DNS record types, and in code port those back to an the supposed 'source' counterpart, I would not be able to do so.

    Is there something I'm missing here? Why is it not possible to get the DNS records just like they're mentioned in the zonefile?

    Like;
    Code:
    [Line] => 18
    [name] => mydomain.
    [ttl] => 14400
    [class] => IN
    [type] => LOC
    [rawvalue]=>51 30 12.748 N 0 7 39.612 W 52.00m 10m 10m 10m
     
  2. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,838
    Likes Received:
    276
    Trophy Points:
    193
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @bouvrie

    You're correct it should be returning a valid Latitude/Longitude per the description in the documentation. I've opened a case on this CPANEL-23335 and I'll update here when I have more information.

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice