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.

Retrieving all DNS zone information

Discussion in 'cPanel Developers' started by madsere, Feb 1, 2012.

  1. madsere

    madsere Well-Known Member

    Joined:
    Apr 7, 2004
    Messages:
    49
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    DataCenter Provider
    Where is the zone data stored when a new domain is created? Presumably Cpanel stores the settings somewhere so it knows about custom modification etc? Or does it read back the actual Named zone files when you update dns information?

    For a third-party application I need to be able to extract all the zone information in an easy way. I could loop through the Named zone files but other control panels I know of store this stuff in a database somewhere.
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    I have move your post out of the feature request thread you posted to since it seemed to be an integration question.

    Grabbing all DNS records from all DNS zones can be done via our APIs, here's some documentation:

    XML and JSON APIs

    If you program in PHP, you can use our PHP class as a means of getting started with the XML API, a link to that can be found at:

    cPanel & WHM's SDK
     
  3. madsere

    madsere Well-Known Member

    Joined:
    Apr 7, 2004
    Messages:
    49
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    DataCenter Provider
    Sorry about that.

    I need to read all domain records - 500+ domains. So that would mean first calling listzones to retrieve a list of all the zones, then for each zone call dumpzone. That's 500 HTTP calls. Even done locally that's less than optimal for what I need to do.

    Isn't there a better way to retrive all zone information in one go? Surely it must be stored somewhere in a file or database or something?

    I think it would probably even be faster, more efficient and easier to simply read through the zone files using something like DNS:ZoneParse than using the API.
     
    #3 madsere, Feb 2, 2012
    Last edited: Feb 2, 2012
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The zone files are individually stored in /var/named location when using BIND where each is named .db such as mydomain.com.db file. The configuration file is at /etc/named.conf

    Now, if you would like to use a setup where you have MySQL for the zone entries, we will be offering MyDNS with 11.31/11.32 (already in EDGE build and shortly to be pushed into CURRENT). Under MyDNS, zones are stored in a MySQL database called mydns_host where the rr table contains the zone file entries for each domain. It would be far easier under MyDNS to pull the information you are seeking.
     
  5. madsere

    madsere Well-Known Member

    Joined:
    Apr 7, 2004
    Messages:
    49
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    DataCenter Provider
    Right. So at this time WHM/Cpanel does not maintain it's own files but simply reuse the standard Bind zone files?

    The MyDNS solution sounds like a perfect fit. Any idea when that will be moved to CURRENT?
     
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Correct, we simply use standard bind zone files for named service.

    As for when CURRENT will see 11.32 and MyDNS as an option, I cannot provide an exact timeframe for release, but we are definitely close to it being available. EDGE has had 11.31 since the end of October (see 11.32 Development Version Announcement - cPanel Inc. for the date), so we have had sufficient time to troubleshoot any defects in that non-production build.

    You may wish to subscribe to our releases mailing list so that you will be aware when CURRENT does have 11.32 released:

    Releases Mailing list - cPanel Inc.
     
  7. madsere

    madsere Well-Known Member

    Joined:
    Apr 7, 2004
    Messages:
    49
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    DataCenter Provider
    Ok thanks. I've subscribed to the list.
     
  8. madsere

    madsere Well-Known Member

    Joined:
    Apr 7, 2004
    Messages:
    49
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    DataCenter Provider
    Seems 11.32 is now out and my server has been updated to it (says WHM 11.30.6 (build 3) on the top right).

    I don't find any place to switch to MyDNS though. Nameserver selections are limited to BIND and NSD or Disabled.

    Is there a guide somewhere how to install and integrate/upgrade it with WHM/Cpanel somewhere?
     
  9. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    11.32 isn't out yet for CURRENT. You are using 11.30 (11.30.6.3) rather than 11.32. We only have 11.31 released for EDGE and 11.32 isn't released.
     
  10. madsere

    madsere Well-Known Member

    Joined:
    Apr 7, 2004
    Messages:
    49
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    DataCenter Provider
    Duh, too early, can't read. Sorry. Assumed the next update would have the MyDNS option. Too bad.
     
  11. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    We are looking like the possibility that the next 2-4 weeks we might be seeing CURRENT with 11.32 out, so it shouldn't be too long. I cannot give an actual timeframe other than it might happen soon based on the EDGE releases and quality assurance that has been happening for 11.31.

    You would get the announcement on that releases list, so hopefully it will be soon so that you can implement the MyDNS feature. Any feedback you have once you do enable that option, please feel free to post it here as we are very interested in customer input on how it is working for you.
     
Loading...

Share This Page