Configuration

Configuration

Create a basic configuration file by using :

./cli/cli.php install defaultconf

Edit the created configuration file (/etc/domdns/configuration.php or datas/configuration.php) to add the DNS servers and the database used to store the zones and records

<?php
$conf = array (
  "servers"=>array (
      "192.168.56.110" => array (  // IP of DNS server
          "type"=>"bind",          // Actually, only bind is allowed
          "methodCLI"=>"ssh",      // Can be ssh or sudo
          "methodFILE"=>"scp",     // Can be scp or sudo
          "username"=>"domdns",    // The login used to connect by SSH or sudo
          "password"=>"Secret 1",  // The password used to connect by SSH
          "fingerprint"=>FALSE,    // The SSH fingerprint
          "publickeyfile"=>FALSE,  // The public key used to connect by SSH
          "privatekeyfile"=>FALSE, // The private key used to connect by SSH
          "passphrase"=>FALSE,     // The passphrase used to open the private key
          "zonepath"=>"/etc/bind/zones", // The path of the zones
      ),
  ),

  "database"=> array (
     "dsn" => "sqlite:./datas/database.db", // The PDO DSN
     "username" => null,                    // The username to connect to database
     "password" => null,                    // The password to connect to database
     "driver_options" => null,              // The drivers options
  ),

  "zone"=>array (
     "soa-server"=>"dns1.domain.tld.",      // The Server responsible of zones
                                            // (with end dot)
     "soa-email"=>"dnsmaster.domain.tld.",  // The mail administrator
                                            // (with end dot)
     "soa-refresh"=>3600,                   // The SOA refresh parameter
     "soa-retry"=>900,                      // The SOA retry parameter
     "soa-expire"=>604800,                  // The SOA expire parameter
     "soa-minttl"=>3600),                   // The SOA minttl parameter
);

On DNS server, create the domdns user with main group bind :

adduser --system --home /var/cache/bind --gecos "DomDNS user" \
            --ingroup bind --no-create-home \
            --disabled-password --quiet --shell /bin/sh domdns

Double check that /etc/bind/zones is writeable for group bind, or force it :

chown domdns:bind /etc/bind/zones
chmod 775 /etc/bind/zones

You have to choose access from your Web server to your bind server by sudo or SSH. To see how to configure the servers, click on the DNS Configuration page.

Database creation

When the configuration is done, you can create the database tables with :

./cli/cli.php install createDB

Cron configuration

Cron is used to enable/disable a zone or a record if the date of openning/closing is crossed. To enable this feature, you need to configure the cron system. In /etc/cron.d/domdns, write

* * * * * www-data /usr/share/domdns/cli/cli.php cron all > /dev/null

Then go to the DNS server configuration