Installing PowerDNS (With MySQL Backend) And Poweradmin On Ubuntu 8.10 - Page 2

Now fill in your database details. It is important that you fill in the details for the MySQL root user, not the powerdns MySQL user we created earlier! Also provide a password for the admin user for the Poweradmin web interface (that's the password that the user admin will use to log in to Poweradmin later on):

On the next page, fill in the details for the power_admin MySQL user that we created in chapter 3. Also fill in the two default nameservers that will be used in your zones unless you provide different nameservers when you create a zone (typically these are the names of the current system and of the slave server (for which you can set up MySQL replication, see my preliminary notes in chapter 1)):

On the next screen the installer asks you to execute a MySQL query. We don't have to do that because we've done something similar in chapter 3 already (the two GRANT statements) so we are set. Click on Go to step 6:

Click on Go to step 7:

The installation is now finished...

... but for security reasons we must delete the install directory:

rm -fr /var/www/poweradmin/install/

Now you can go to http://server1.example.com/poweradmin or http://192.168.0.100/poweradmin and log in with the username admin and the password you created during the installation:

This is how the Poweradmin web interface looks:

To create a zone, go to Add master zone and fill in the domain name (e.g. example.com). You can already fill in the IP addresses for the www A record ("webserver") and the MX record ("mailserver") for that zone. If you leave the Create zone without applying records-template checkbox unchecked, Poweradmin will automatically create some NS, A (e.g. www) and MX records for that zone:

Go to List zones afterwards. You should now see the new zone there, and it already has eight records. Click on the edit icon to see these eight records:

These are the records that are created automatically unless you check the Create zone without applying records-template checkbox when you create a zone. You can now edit them or add and delete records:

Of course, you can as well create all records one-by-one manually - just leave the IP address fields empty and check the Create zone without applying records-template checkbox on the Add master zone page:

On the List zones page you will see that the new zone has just one record (the SOA record). Click on the edit icon...

... and then on Add record to add further records, ...

..., e.g. NS records...

... and A records (e.g. for mydomain.com (leave the Name field empty!) and www.mydomain.com)...

... and MX records:

To create PTR records, go to the Add master zone page and create a zone called in-addr.arpa (leave the IP address fields empty and check the Create zone without applying records-template checkbox):

To create a PTR record that points from the IP 1.2.3.4 to server1.example.com, create a record under List zones and fill in 4.3.2.1 in the Name field (that's the IP in reverse order) and server1.example.com in the Content field:

After you've created your records, you can check them with the dig command (see

man dig

for more details), e.g. as follows:

dig @localhost mx example.com

root@server1:~# dig @localhost mx example.com

; <<>> DiG 9.5.0-P2 <<>> @localhost mx example.com
; (2 servers found)
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15084
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;example.com.                   IN      MX

;; ANSWER SECTION:
example.com.            86400   IN      MX      10 mail.example.com.

;; ADDITIONAL SECTION:
mail.example.com.       86400   IN      A       1.2.3.4

;; Query time: 12 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Jan 15 16:15:48 2009
;; MSG SIZE  rcvd: 66

root@server1:~#

 

5 Links

Share this page:

3 Comment(s)

Add comment

Comments

From: Some Guy at: 2009-05-27 18:07:18

Hello, great article! I would recommend 2 small changes on the create table code however. According to the PowerDNS docs, you will get better performance by using InnoDB. From the page http://doc.powerdns.com/generic-mypgsql-backends.html: In practice, great results are achieved with the 'InnoDB' tables. PowerDNS will silently function with non-transaction aware MySQLs but at one point this is going to harm your database, for example when an incoming zone transfer fails. In order to do this, you would change the domain create statement to read: create table domains ( id INT auto_increment, name VARCHAR(255) NOT NULL, master VARCHAR(128) DEFAULT NULL, last_check INT DEFAULT NULL, type VARCHAR(6) NOT NULL, notified_serial INT DEFAULT NULL, account VARCHAR(40) DEFAULT NULL, primary key (id) )engine=InnoDB; To create the records table as InnoDB, do the following: CREATE TABLE records ( id INT auto_increment, domain_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, type VARCHAR(6) DEFAULT NULL, content VARCHAR(255) DEFAULT NULL, ttl INT DEFAULT NULL, prio INT DEFAULT NULL, change_date INT DEFAULT NULL, primary key(id) )engine=InnoDB; Additionally, you can create cascading restraints on different fields... In plain english, you can have MySQL automatically delete records in the records table that are associated with a domain that has been deleted. To add this constraint, instead use the following create statement for the records table: CREATE TABLE records ( id INT auto_increment, domain_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, type VARCHAR(6) DEFAULT NULL, content VARCHAR(255) DEFAULT NULL, ttl INT DEFAULT NULL, prio INT DEFAULT NULL, change_date INT DEFAULT NULL, primary key(id), CONSTRAINT `records_ibfk_1` FOREIGN KEY (`domain_id`) REFERENCES `domains` (`id`) ON DELETE CASCADE )engine=InnoDB; I have set my environment up this way and have no complaints, but your milage may vary. Either way, I just wanted to give an alternative that people may find useful.

From: Peter van Dijk at: 2012-10-04 12:39:55

Don't install an in-addr.arpa zone. You don't own it, and your nameserver should not claim to - it causes problems!

Ask your hosting provider for the exact zone name to configure - usually something like 3.2.1.in-addr.arpa.

From: bathmate at: 2012-11-06 02:13:47

It is very easy,just like installing wordpress blog.