jameshsi

Well-Known Member
Oct 22, 2001
347
0
316
Hi!
I use my script to create DNS zone files, why ? Cause I got some domains not in the server but I have to provide them DNS services, now, I try to use DNSonly and I found it seems only good for the domain is hosting on the server.

Is there any API or /scripts/xxx.pl to let me change the zone files and it will also sync to the dnsonly servers ?

Regards,

James
 

bigste

Member
Jan 6, 2009
20
0
51
Cheshire, UK
Cause I got some domains not in the server but I have to provide them DNS services
couldn't you just create accounts for these domains even though they don't live on your server. Then you could edit their Zones files to reflect where they do live.
How many of these domains do you have?
 

acenetryan

Well-Known Member
PartnerNOC
Aug 21, 2005
197
1
168
The cPanel API is a very handy tool for performing cPanel requests outside of the cPanel interfaces themselves. PHP is my language of choice and with a little coding, you can easily write a script to take your DNS modifications and mimic them to your server and cluster. Honestly, I don't know if there is an API call to the server which will automatically sync the DNS zone with the slave cluster. If not, you can just mimic the editdns API call to those servers as well within your script.

Here are some of the helpful links I keep handy for when I want to go making API calls.

http://www.cpanel.net/plugins/xmlapi/
http://forums.cpanel.net/showthread.php?t=76995
http://forums.cpanel.net/showpost.php?p=322538&postcount=6
http://us2.php.net/manual/en/book.xml.php
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
79
458
cPanel Access Level
Root Administrator
Zones added via the 'Add a DNS Zone' function with WHM will be synced in a cPanel DNSONLY environment.

There is an XML API call for this, which you could use to add the Zones. If you go this route, you'll need to remove the zones from named.conf and /var/named before hand ( making backups of course ).

Another quicker way that might work, but is untested and unrecommended, is to add the zone name ( e.g. example.com ) to root's user file in /var/cpanel/users. In the format DNS#=example.com where the # is an incremented number. That should create the ownership and necessary link within the product for them to be synced into the cluster.