Slave DNS with Enhance Control Panel

About this script

ClouDNS has developed a PHP script especially for our customers who are using the Enhance Control Panel. This script is designed to work with Master (Primary) DNS zones, hosted with Enhance. You can download it from our GitHub repository.

How does it work?

Once executed, the script will read all DNS zones from a preconfigured BIND file on your server. Every filename, which is not a DNS zone, will be written into the temporary file, configured in the script and ignored in the future. All Master DNS zones that exist on your server will be created at ClouDNS as Slave DNS zones with the configured IP address as the Master server.

How to configure it?

Before using this script, you must make sure that you have API access and an API user at ClouDNS. To do it, please click on the "API" button in your Dashboard. Next, click on "Add new user" in the upper right corner in the section "API users". Once you add the API user, you have to download the script from our GitHub repository. When you download it, please open it with your preferred PHP/text editor. You will have to edit these lines in the script:

// Auth ID and Password
define("AUTH_ID", xxx); - replace xxx with your API user ID
define("AUTH_PASS", "xxx"); - replace xxx with API user password
// IP address of the master server
define("MASTER_IP", "xxx.xxx.xxx.xxx"); - replace xxx.xxx.xxx.xxx with IP address of your server
// the path to the BIND file, the names inside are used to create the slave zones
define("BIND_CONFIG_FILE", "/etc/dnscd/named.conf"); - BIND file path
// this file will contain a list of files that are not dns zone files and there won't be a request to be added the next time the script runs
define("TMPFILE", "/tmp/cloudns_invalid-zone-names.txt"); - temporary file

After you edit the script with your credentials, please add the IP addresses of our name servers in allow-transfer and also-notify in options{} at /etc/named.conf. The file should look like:

options {
     allow-transfer {
            109.201.133.61;
            185.136.96.96;
           # If you use IPv6:
            2a00:1768:1001:9::21;
            2a06:fb00:1::1:96;
      };
      also-notify {
            109.201.133.61;
            185.136.96.96;
            # If you use IPv6:
            2a00:1768:1001:9::21;
            2a06:fb00:1::1:96;
     };
disable-axfr=no;
};

Please have in mind that these are example IP addresses of our name servers. The servers available for you may differ and we recommend adding the IP addresses listed on the right side of your Dashboard. Once you enter your credentials and the IP address of your server, save the script and configure your DNS server, you can execute it.

Note: We recommend creating a cron job for this script in order to be executed every 30 minutes. This way, it will automatically add all new DNS zones in the future.


Last modified: 2025-07-01
Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more