<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Debian Tutorials &#187; pdns</title>
	<atom:link href="http://www.debiantutorials.com/tag/pdns/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.debiantutorials.com</link>
	<description>Copy/Paste tutorials for Debian based Linux distros</description>
	<lastBuildDate>Tue, 27 Dec 2011 01:15:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Installing PowerDNS as supermaster with slaves</title>
		<link>http://www.debiantutorials.com/installing-powerdns-as-supermaster-with-slaves/</link>
		<comments>http://www.debiantutorials.com/installing-powerdns-as-supermaster-with-slaves/#comments</comments>
		<pubDate>Sun, 11 Dec 2011 10:41:27 +0000</pubDate>
		<dc:creator>aip</dc:creator>
				<category><![CDATA[DNS]]></category>
		<category><![CDATA[Squeeze]]></category>
		<category><![CDATA[pdns]]></category>
		<category><![CDATA[powerdns]]></category>

		<guid isPermaLink="false">http://www.debiantutorials.com/?p=432</guid>
		<description><![CDATA[The PowerDNS Nameserver is a modern, advanced and high performance authoritative-only nameserver. It is written from scratch and conforms to all relevant DNS standards documents. Furthermore, PowerDNS interfaces with almost any database. This tutorial has been tested to be working on Debian squeeze. It's assumed that you are installing one supermaster and one or more [...]]]></description>
			<content:encoded><![CDATA[<p>The PowerDNS Nameserver is a modern, advanced and high performance authoritative-only nameserver. It is written from scratch and conforms to all relevant DNS standards documents. Furthermore, PowerDNS interfaces with almost any database.</p>
<p>This tutorial has been tested to be working on Debian squeeze. It's assumed that you are installing one supermaster and one or more slaves that will sync with the master automatically.</p>
<p><strong>On all servers</strong></p>
<p>1. Install the PowerDNS server and MySql backend using apt</p>
<p><code>apt-get install pdns-server pdns-backend-mysql<br />
</code><span id="more-432"></span></p>
<p>2. Create a new database (or use existing) and execute the following SQL queries to create the PowerDNS table structure:</p>
<p><code>create table domains (<br />
id INT auto_increment,<br />
name VARCHAR(255) NOT NULL,<br />
master VARCHAR(128) DEFAULT NULL,<br />
last_check INT DEFAULT NULL,<br />
type VARCHAR(6) NOT NULL,<br />
notified_serial INT DEFAULT NULL,<br />
account VARCHAR(40) DEFAULT NULL,<br />
primary key (id)<br />
)type=InnoDB;<br />
&nbsp;<br />
CREATE UNIQUE INDEX name_index ON domains(name);<br />
&nbsp;<br />
CREATE TABLE records (<br />
id INT auto_increment,<br />
domain_id INT DEFAULT NULL,<br />
name VARCHAR(255) DEFAULT NULL,<br />
type VARCHAR(6) DEFAULT NULL,<br />
content VARCHAR(255) DEFAULT NULL,<br />
ttl INT DEFAULT NULL,<br />
prio INT DEFAULT NULL,<br />
change_date INT DEFAULT NULL,<br />
primary key(id)<br />
)type=InnoDB;<br />
&nbsp;<br />
CREATE INDEX rec_name_index ON records(name);<br />
CREATE INDEX nametype_index ON records(name,type);<br />
CREATE INDEX domain_id ON records(domain_id);<br />
&nbsp;<br />
create table supermasters (<br />
ip VARCHAR(25) NOT NULL,<br />
nameserver VARCHAR(255) NOT NULL,<br />
account VARCHAR(40) DEFAULT NULL<br />
);<br />
</code></p>
<p>3. Configure PowerDNS to use the MySql backend by adding this line into the configuration file (pico /etc/powerdns/pdns.conf)</p>
<p><code>launch=gmysql<br />
</code></p>
<p>4. Configure MySql login information for the PowerDNS by adding lines similar to these (pico /etc/powerdns/pdns.d/pdns.local).</p>
<p><code>gmysql-host=127.0.0.1<br />
gmysql-user=pdns<br />
gmysql-password=password<br />
gmysql-dbname=pdns<br />
</code></p>
<p>Replace the username, password and dbname with a valid login information and database name. Each DNS server in the cluster needs to have a dedicated local database.</p>
<p><strong>On the master server</strong></p>
<p>5. Allow zone transferes and enable master operation. (pico /etc/powerdns/pdns.conf)</p>
<p><code>allow-axfr-ips=10.0.0.2<br />
disable-axfr=no<br />
master=yes<br />
</code></p>
<p>6. Add a new zone</p>
<p><code>INSERT INTO domains (name, type) VALUES ('example.org', 'MASTER');<br />
INSERT INTO records (domain_id, name, content, type, ttl, prio) VALUES (1, 'example.org', 'ns1.example.org hostmaster.example.org 1', 'SOA', 86400, NULL);<br />
INSERT INTO records (domain_id, name, content, type, ttl, prio) VALUES (1, 'example.org', 'ns1.example.org', 'NS', 86400, NULL);<br />
INSERT INTO records (domain_id, name, content, type, ttl, prio) VALUES (1, 'example.org', 'ns2.example.org', 'NS', 86400, NULL);<br />
INSERT INTO records (domain_id, name, content, type, ttl, prio) VALUES (1, 'ns1.example.org', '10.0.0.1', 'A', 86400, NULL);<br />
INSERT INTO records (domain_id, name, content, type, ttl, prio) VALUES (1, 'ns2.example.org', '10.0.0.2', 'A', 86400, NULL);<br />
</code></p>
<p><strong>On the slaves</strong></p>
<p>7. Enable slave operation (pico /etc/powerdns/pdns.conf)</p>
<p><code>slave=yes<br />
</code></p>
<p>8. Make the master server a supermaster for the slave. If supermaster is specified, all new zones will be added automatically to the slave when notified by the master.</p>
<p><code>INSERT INTO supermasters (ip, nameserver, account) VALUES ('10.0.0.1', 'ns2.example.org', '');<br />
</code></p>
<p><em>Assuming the master IP address is 10.0.0.1</em></p>
<p><strong>On master and slaves</strong></p>
<p>9. Restart PowerDNS</p>
<p><code>/etc/init.d/pdns restart<br />
</code></p>
<p><strong>On the master</strong></p>
<p>10. Trigger a notify</p>
<p><code>UPDATE records SET content = 'ns1.example.org hostmaster.example.org 2' WHERE type = 'SOA' AND name = 'example.org';<br />
</code></p>
<p><em>Increasing the serial will sync data from the master to the slave</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.debiantutorials.com/installing-powerdns-as-supermaster-with-slaves/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
