Versions Compared

Key

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

...

  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.