Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

If you use the default WHMCS DNS management, it is recommended to activate the "Create DNS Zone" mode, see module settings. The module can set the default value for new DNS zones via the interfacemodule settings. Furthermore the module has the possibility to add own DNS records via a PHP function. This is helpful if you want to create additional default records or if you want to create the DNS records service based.

...

  1. Navigate into the directory /modules/registrars/smartnic/
  2. Create the file customdns.php with following content:

    Code Block
    languagephp
    linenumberstrue
    <?php
    
    function smartnic_customDNS ($params) {
    	return array (  array ('hostname' => '@', 'type' => 'a', 'address' => '5.4.3.2', 'aux' => '', 'ttl' => '300'),
                        array ('hostname' => 'www', 'type' => 'a', 'address' => '5.4.3.2', 'aux' => '', 'ttl' => '300'),
                        array ('hostname' => '@', 'type' => 'MX', 'address' => 'mail.example.org', 'aux' => '1', 'ttl' => '300'),
        );
    }

    Of course you You have to adjust the array according to your wishesneeds. AUX stands for the priority of the record, which only plays a role for MX and SRV records.

In the The $params argument you can find contains all the details of details about the domain, which allows you to programmatically store DNS records depending on the domain. Detailed information about the content are available here.