cPanel & WHM Version 98 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Export dns zone file option in WHM

spaceman shared this idea 7 years ago
Open Discussion

I'm looking at a DNS zone file in WHM


Home > DNS Functions > Edit DNS Zone


I'd like to see a 'Export' option here, so that we can download a text record/copy of the zone file. I've got a client asking for this now, and it appears there's no easy way to do this currently other than to go to the command line and dig the info out of /var/named and/or /etc/named/conf


(see: http://serverfault.com/questions/130756/how-to-export-zone-file-in-whm-webhost)

Replies (14)

photo
1

Could you please elaborate on the use cases for this feature?


For what end-purpose is the customer requesting this data? If it's to use it with another cPanel & WHM server, I expect you'd want an "Import" feature as well. This becomes a bit more complex.


If they simply want a copy of it for reference/other purposes, note that a backup of their site (which I would recommend all cPanel account owners maintain at all times) would have a direct copy of their BIND zone file(s).


Primarily, I'm curious about the use case(s) for this request and what is necessitating the export of a zone to the raw BIND zone format on such a frequent basis.

photo
5

I can say for myself that introducing CDN to a website, having a export on zones would make my life easier.


CloudFlare, for example would benefit greatly with this, I understand that "partnered" CloudFlare VPS providers offer this functionality, but you would need to be a provider for that functionality.


x%2010%20hosting (not to advertise, web devs should understand it ;)) has an export for CDN's and whatever else you may want a bind file for.


Would proxies count ? I'd imagine they would fall under a CDN ? I think I am grasping at straws right now but that's one reason why I think having a export for "Normal" cpanel users (not excluding resellers).

photo
2

The most likely usage scenario for this seems pretty clear to me. If a user wants to start using another service provider for the DNS records, the easiest way to transfer over is with a BIND zone file or a regular DNS zone file. It should be fairly simple for CP/WHM to be able to generate and export such a file with the necessary zone data.

photo
photo
1

In this specific case, it was a government client requesting a copy of their zone file for their own internal records. So it wasn't for the purpose of importing elsewhere, as far as I know. It was simply that they wanted a quick, easy record of the zone file today.


I understand that a copy of the zone file is included in the backup of the site.... so this request is really about the immediacy of making this specific information available right now, from WHM, in a downloadable (or cut 'n paste) text format (as opposed to a screen print), without having to go looking/digging/extracting elsewhere.


I'm hoping/assuming that this "Download as a txt file" option should be that technically difficult given that when I choose to "Edit DNS Zone" the information has already been retrieved (and presented 'nicely' for the purposes of editing).

photo
2

I would like to see this feature in cPanel interface as well. Some clients request the zone files when they are making changes or using 3rd party service providers / move to new name servers.

photo
4

A real world example is people switching their name servers to CloudFlare but keeping everything else in cPanel.


Using the cPanel tools and then exporting the zone data from there and importing it to CloudFlare would be great.


Current workaround

  • Create a backup in cPanel
  • Download and untar it
  • Rename dnszones/domain.com.db to domain.com.txt, domain.com.zone, domain.com.bind or whatever your new service wants (txt for CF)
  • Import to your file to the new service

photo
1

+1 for exporting the zone file for importing to other sources. We'd use it for CloudFlare.


FYI: They do a great job of guessing standard DNS records but not the newer carddav records. Copying and pasting values one by one is not viable. And then there's potentially custom records, of course, not guessable.


While we'd be happy with manual for now, this would eventually be useful for consumption via API, so that custom software which uses CloudFlare's API to add zone records could also retrieve it from WHM without manual intervention. (Sounds like from the OP this could be scripted up but if there were a download then making it available for automation would be the natural next step.)

photo
2

You can simply go to var/named then download each zone... and rename the file to .txt for use with cloudflare.

photo
2

This isn't an option for clients themselves.

photo
1

Not within the CPanel web interface, but it is in the backup file under /dnszones/[domain].db

photo
photo
1

+1 absolutely, were hosting out dns on aws route53, and this would be very helpful to us.

photo
1

I have an Idea, Go to WHM dashboard, net click on reset dns for the doman that you want to export DNS, when done, a page with this info:

Reset DNS Zone karrito.com


Zone Reset: mydomain.com:


New Zone:


Here you will found a boxe with all setting.

Now, copy the content, and in a text editor paste the content that you are you copied and save it as dns.txt.


Go on Cloudflare or your CDN company, upoad the cdn.txt file and


And Done!

photo
1

That's a great idea! It would work quite well if you only need to do one or two zones, for sure. It probably won't be optimal if you have a lot of clients that you need to do this for, or for anyone with only cPanel access, but it does help one use-case. Thanks for offering one potential workaround!

photo
1

Could be great if we could have custom DNS templates-- specially Google G-Suite MX Records

photo
2

It's been 4 years. The need for this feature is growing all the time. Is there any plans to make this happen? Technically this shouldn't be a huge project.

photo
2

There should be an option to import export DNS zone files as it's been provided by any simple hosting provider.

photo
2

We just has the situation where we needed to copy the zone file from a cPanel account where we DON'T have WHM/root access, to a cPanel account where we DO.


It would have been extremely helpful if we'd had the option/feature to export the zone file from the cPanel account, and then import it into our own WHM/cPanel account.


But in the absence of this feature, we had to cut and paste by hand, line by line, which is less than ideal.... and pretty crazy when both accounts, source and destination, are cPanel accounts.

photo
photo
7

This (lack of a) feature is a way bigger deal than it seems to get credit for. There are the obvious reasons:

copying by hand is not always practical, and creates lots of opportunities for mistakes - cPanel's inadequacy in this area is something that we have to ACTIVELY watch out for with clients, as we've learned that the clunky moving process is not something you want to do in a crunch or emergency (when it absolutely should not be).


If someone only has access to cPanel, it is not only absurd to suggest that anyone should download a multiple-gig-rar file just to get a copy of the dns file(s), it is a security concern. It is effectively forcing users to download any and all sensitive information currently on their servers to their computers in order to acquire otherwise publicly accessible data. Less savvy, lazy, or even just over-worked operators can easily forget to properly dispose of this data, either not knowing or not realizing how extraordinarily sensitive it can be.

photo
1

Another example, importing an exported Godaddy ZONE file. We have a situation right now where we'll have to copy paste about 50 lines from GD to cPanel. Risk exposure is pretty high this way on missing something.

photo
2

I needed to export a DNS zone today and I was surprised to see that there's no native feature in cPanel/WHM to do it. This is needed asap!

photo
3

It seems like a small job for cPanel to add this functionality, yet it would have huge benefits for many system admins. We routinely have to update a dozen DNS records on Cloudflare, when they offer an import option.


Can someone from cPanel review this again and provide an update?

photo
2

I would also like to see this feature.


One workaround for Cloudflare is to add your site to Cloudflare first, before changing Nameservers, and it will pull in the current DNS records from your current server. Then change the nameservers to point to cloudflare.

Unfortunately however, this doesn't seem viable if the domain's nameservers aren't currently pointed at your cPanel server.

photo
1

It looks like they are implementing an option via WHM API 1 . It's one step closer.

Leave a Comment
 
Attach a file