Using PowerDNS with DNSmanager

From ISPWiki

Jump to: navigation, search

Contents

Installing PowerDNS

If you install on a fresh server, select a required version of PowerDNS. If you install on the server with MySQL, you will be prompted to enter the root password.

Automatic restart of PowerDNS is not required. If this option is on, disable it.

Run the following command to start all PowerDNS servers:

/usr/local/ispmgr/sbin/mgrctl -m dnsmgr bindip

It will be automatically specified in /etc/rc.local

Customizing DNSmanager

Specify the following parameter in /usr/local/ispmgr/etc/dnsmgr.conf

DNSserver powerdns

Create a MySQL user to work with the database.

Provide the following parameters to connect the databases to the servers:

PdnsDBHost <hostname> 
PdnsDBUser <user> // root by default
PdnsDBPassword <pass>  //  <user> password
PdnsDBSocket <socket>  // path to MySQL UNIX socket

Please note, that the MySQL user must have privilege to add and delete databases and tables.

You may also use the following parameters:

  • path pdns_control default value /usr/local/bin/pdns_control - the path to the pdns_control utility
  • path pdns_server default value /usr/local/sbin/pdns_server - the path to pdns_server
  • path ConfigDir default value /usr/local/etc/pdns - the directory where name server configuration files should locate

You can also edit the PowerDNS configuration file template according to your needs.

/usr/local/ispmgr/etc/pdns.conf.template

DNSmanager creates the configuration files of the PowerDNS server basing on this template. Please note!!! The file appears when starting DNSmanager for the first time, otherwise it is located in:

/usr/local/ispmgr/etc/dist/pdns.conf.template

Principle of operation

Since there is no view in PowerDNS, in order to separate your users you should run separate copies of the server each of them working with a separate configuration file and database.

When creating a new name space, a database and the PowerDNS configuration file, a new copy of the server are created.

A database name corresponds to that of a name space, with the dot changed into the "_" symbol.

The configuration file's name is formed in the same manner, but it has a pdns- prefix and .conf suffix.

For more information about how to customize a name server please visit http://doc.powerdns.com/

Transferring from an existing server with named

We attempted to maximally automate change of a DNS server.

  • Stop named and disable the automatic start in the configuration file. This step is required to release the IP-addresses.
  • Comment out "DNSserver powerdns" in the configuration file. After transfer has been complete, uncomment it.
  • Run the command
/usr/local/ispmgr/sbin/mgrctl -m dnsmgr convert.dns to=powerdns

After a while transfer will start and the zone will run. Please note!!! If the name server has too many zones (more than 1000), we recommend enlarging the slave-cycle-interval parameter. The more the number of zones, the more the evaluation period (one hour for about 100 000 domains). After the primary zones' transfer has been completed, you may set the previous period (one minute).

If something has gone wrong, you can roll back to named.

1) stop the PowerDNS servers

killall pdns_server

2) run named

3) in dnsmgr.conf specify

DNSserver named

4) restart DNSmanager

killall dnsmgr

Additional functions

DNSmanager 4.3.21:

domain.sharedbad - get a list of domains, which records are kept in MySQL, but the owner is not defined.

For example:

/usr/local/ispmgr/sbin/mgrctl -m dnsmgr domain.sharedbad [delete=yes]

If the "delete=yes" в dnsmgr.log parameter is not used, a list of domains will be displayed. Otherwise they will be removed.

Was this helpful? Yes | No
Personal tools