Posts Tagged ‘logicsupport’

Powerdns

Tuesday, February 2nd, 2010

Powerdns uses mysql database to retrieve domain information. Therefore, it is very important to check for the following details while trouble shooting issues with powerdns.

I will cite the example below from an lpanel server :-

As always, you need to chroot to the domain’s environment.

chroot /home/domain.com/runtime_layeredpanel/

Go to /etc/init.d

vi lpanel

You will see an try similar to this :

/etc/init.d/pdns start

vi /etc/init.d/pdns

If you do a simple locate,

locate powerdns | less

You see that the configuration files lie in /etc/powerdns/

cd /etc/powerdns

You can see the main configuration file and the include directory.

pdns.conf pdns.d

vi pdns.conf

#################################
# launch Which backends to launch and order to query them in
#
launch=gmysql

#################################

The section above decides which backend database powerdns uses to query the data. In the above example, it uses mysql server. It can be ‘bind’ too.

To get the mysql connection details, open the pdns.d/pdns.local file

The first section shows the database connectivity details :

gmysql-dbname=databasename
gmysql-socket=/var/run/mysqld/mysqld.sock
gmysql-user=username
gmysql-password=password

Please make sure the above username and passowrd combination works by testing it :

mysql -u username -p
password: [type the password above]

If it doesn’t work, make sure you login as mysql root to give necessary privileges for the user to allow access to the databasename.

This can be done using the query ‘grant all privileges on databasename.* to username@localhost identified by ‘password’
after logging in as root user.

Once you fix the database problem, pdns server will not have issues sending back answers to your dns queries.

Technical review department
LogicSupport.com