HCCDns A Custom API for Cpanel Version 0.1.1 beta 11/MAY/2005 © 2002,2005 Juan R. Pozo http://html.conclase.net/cp/scripts/ mailto:jrpozo@conclase.net Mailing list: http://www.conclase.net/mailman/listinfo/cpanel_conclase.net License This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Note: a copy of the GNU General Public License is available at: http://html.conclase.net/cp/scripts/license.html Installation 1) Check if the file HCCDns.pm exists in your server inside the /usr/local/cpanel/Cpanel/ directory 2) If it exists and isn't a previous version of this API please contact me. Otherwise, follow steps 3 to 8 3) switch to root user 4) # cd /usr/local/cpanel/Cpanel/ 5) # wget –N http://html.conclase.net/cp/scripts/HCCDns.pm 6) # chown root.root HCCDns.pm 7) # chmod 0644 HCCDns.pm 8) Add the following language variables to your language files: // HCCDns (English) HCCDns_errstr_nons=No name servers found HCCDns_errstr_nopipe=Couldn't fork process HCCDns_errstr_nodig=Couldn't execute dig command HCCDns_errstr_nowhois=Couldn't execute whois command // HCCDns (Spanish) HCCDns_errstr_nons=No se encontraron servidores de nombres HCCDns_errstr_nopipe=No se pudo bifurcar proceso HCCDns_errstr_nodig=No se pudo ejecutar el comando dig HCCDns_errstr_nowhois=No se pudo ejecutar el comando whois API Reference Lists the domain name servers. These are the name servers the user should configure for the domain to work correctly. The function first determines who the owner (reseller) of the domain is, so that the correct name servers will be displayed. If no name servers are found, the following variables are set: $CPERROR{'HCCDns'} = 1 $CPERROR{'HCCDns_nons'} = 1 $CPERROR{'HCCDns_errstr'} = Lists the current name servers for the given domain. If no argument is given, the main domain for this user is used as the argument. For this function to work the /usr/bin/dig program must be executable by anyone. If no name servers are found, the following variables are set: $CPERROR{'HCCDns'} = 1 $CPERROR{'HCCDns_nons'} = 1 $CPERROR{'HCCDns_errstr'} = If the process cannot be forked to open the dig command, the following variables are set: $CPERROR{'HCCDns'} = 1 $CPERROR{'HCCDns_nopipe'} = 1 $CPERROR{'HCCDns_errstr'} = If the dig command is not found or cannot be executed, the following variables are set: $CPERROR{'HCCDns'} = 1 $CPERROR{'HCCDns_nodig'} = 1 $CPERROR{'HCCDns_errstr'} = Gives the whois information about the specified domain. If no domain name is provided, the main domain for this user is taken. For this function to work the /usr/bin/whois program must be executable by anyone. If the process cannot be forked to open the whois command, the following variables are set: $CPERROR{'HCCDns'} = 1 $CPERROR{'HCCDns_nopipe'} = 1 $CPERROR{'HCCDns_errstr'} = If the whois command is not found or cannot be executed, the following variables are set: $CPERROR{'HCCDns'} = 1 $CPERROR{'HCCDns_nowhois'} = 1 $CPERROR{'HCCDns_errstr'} = Displays the results of running the command dig domain type where type is the query type. Allowed query types are: A, CNAME, MX, NS, PTR, SOA and ANY (case insensitive). If no domain name is provided, the main domain for this user is taken. If no query type is provided, the A value is taken. For this function to work the /usr/bin/dig program must be executable by anyone. If the process cannot be forked to open the dig command, the following variables are set: $CPERROR{'HCCDns'} = 1 $CPERROR{'HCCDns_nopipe'} = 1 $CPERROR{'HCCDns_errstr'} = If the dig command is not found or cannot be executed, the following variables are set: $CPERROR{'HCCDns'} = 1 $CPERROR{'HCCDns_nodig'} = 1 $CPERROR{'HCCDns_errstr'} = Changelog 0.1.1 Beta – 11/MAY/2005 Fixed lang function to account for Cpanel's cachelang mechanism. 0.1 Beta – 23/SEP/2003 Forked from HCCApi 0.3.7. First public release. Added $CPERROR error codes. CurrentNameServers has a bigger set of public nameservers to choose from. The Whois and Dig output is no longer enclosed in a DIV element. Please consider making a donation today. Visit my amazon.com wishlist at: http://html.conclase.net/link/wishlist Thank you :)