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.

Import/Convert BIND zone file to cPanel/WHM server

Discussion in 'Migrate to cPanel' started by ashworth102680, Jan 13, 2012.

  1. ashworth102680

    ashworth102680 Active Member

    Joined:
    May 3, 2007
    Messages:
    26
    Likes Received:
    1
    Trophy Points:
    3
    We have a ton of domains we're trying to take control over from GoDaddy (about time, I know). All of the DNS settings for each domain name exports to a bind-compatible zone file, but in all my searching, I haven't found any creative solutions for either:

    1) Convert from BIND format to cPanel's format (so I can mostly copy/paste into added domains)

    2) Import via some script to convert and insert the records on the fly

    I'm open to any options, but copy/paste for every zone file for every domain doesn't seem like the most productive route to take. Your responses are valued.
     
    #1 ashworth102680, Jan 13, 2012
    Last edited: Jan 13, 2012
  2. ashworth102680

    ashworth102680 Active Member

    Joined:
    May 3, 2007
    Messages:
    26
    Likes Received:
    1
    Trophy Points:
    3
    Nobody's come across this before? Getting zone files converted from BIND to cPanel so we don't need to manually data enter all the zones/records? This seems like it would be something affecting most of us if migrating large quantities of websites from another hosting vendor.
     
  3. cPanelKenSmith

    cPanelKenSmith Registered
    Staff Member

    Joined:
    Aug 17, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    The zone format used by cPanel servers is BIND compatible because the default DNS server in use is BIND. You can also choose to use NSD, however that loads BIND zone files as well.

    You can see the zones currently on the machine by looking in /var/named/*.db. You'll find them all to be standard BIND zone files.
     
  4. ashworth102680

    ashworth102680 Active Member

    Joined:
    May 3, 2007
    Messages:
    26
    Likes Received:
    1
    Trophy Points:
    3
    Okay, so I was thrown off a bit when I looked at the zone files that cPanel created vs. the BIND zone files that I have. They are noticeably different in structure. Maybe cPanel doesn't care, and will automatically detect and fix it?

    chirpy's post below suggests to me that there's more to it than we may be talking about here.

    http://forums.cpanel.net/f5/import-bind-into-dns-only-47561.html
     
    #4 ashworth102680, Jan 24, 2012
    Last edited: Jan 24, 2012
  5. cPanelKenSmith

    cPanelKenSmith Registered
    Staff Member

    Joined:
    Aug 17, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    The zones themselves are bind zones that bind is happy to load and use. Our UI does put some extra comments into the zone files that wouldn't be there normally, but that's because our UI is what's writing and reading them.

    As a test, you could simply copy a couple ones over to a test cpanel machine to the /var/named directory and then go to the "edit dns zone" tool within WHM. If the zones show up okay in the UI you're all set.

    If not, then you may need to modify a few things as Chirpy points out. Also take note that the thread you point out is over 5 years old now. The code involved has changed quite a bit since then.
     
  6. cPanelKeithS

    cPanelKeithS Active Member
    Staff Member

    Joined:
    Oct 14, 2008
    Messages:
    31
    Likes Received:
    1
    Trophy Points:
    8
    I have noticed in the past that the Edit DNS Zone section of WHM does look for comments in the zone file that lets it know the zones were created by cPanel & WHM. This is an example from one of the zones on my server.

    ; cPanel first:11.30.0.32 (update_time):1328727535 Cpanel::ZoneFile::VERSION:1.3 hostname:vps.cpks.info latest:11.30.5.6
    ; Zone file for keithacct2.test

    If you replicate those comments, and have a properly BIND formatted zone file, cPanel & WHM should populate properly.
     

Share This Page