<?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>Christophe Nowicki &#187; MyDNS</title>
	<atom:link href="http://www.csquad.org/tag/mydns/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csquad.org</link>
	<description>Just for fun</description>
	<lastBuildDate>Fri, 14 Jan 2011 08:32:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>DNS Secret Key Transaction Authentication (TSIG) support for MyDNS</title>
		<link>http://www.csquad.org/2006/03/14/dns-secret-key-transaction-authentication-tsig-support-for-mydns/</link>
		<comments>http://www.csquad.org/2006/03/14/dns-secret-key-transaction-authentication-tsig-support-for-mydns/#comments</comments>
		<pubDate>Tue, 14 Mar 2006 09:31:49 +0000</pubDate>
		<dc:creator>cscm</dc:creator>
				<category><![CDATA[Network]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[MyDNS]]></category>
		<category><![CDATA[TSIG]]></category>

		<guid isPermaLink="false">http://www.csquad.org/?p=28</guid>
		<description><![CDATA[ For Work related reasons,  I&#8217;ve added transaction authentication support for MyDNS version 1.1.0 in tree days for one of our clients.
I&#8217;ve used the source code of ISC Bind, OpenSSL and  RFC 2847 to write my patch.
MyDNS
MyDNS is a free (as freedom) DNS server for UNIX systems. It is designed to serve DNS [...]]]></description>
			<content:encoded><![CDATA[<p> For Work related reasons,  I&#8217;ve added transaction authentication support for <a href="http://mydns.bboy.net/">MyDNS</a> version 1.1.0 in tree days for one of our clients.<br />
I&#8217;ve used the source code of <a href="http://www.isc.org/index.pl?/sw/bind/">ISC Bind</a>, <a href="http://www.openssl.org/">OpenSSL</a> and  <a href="http://www.faqs.org/rfcs/rfc2845.html">RFC 2847</a> to write my patch.</p>
<h3>MyDNS</h3>
<p>MyDNS is a free (as freedom) DNS server for UNIX systems. It is designed to serve DNS records directly from an SQL database (<a href="http://www.mysql.com/">MySQL</a> or <a href="http://www.postgresql.org/">PostgreSQL</a> are supported).<br />
It&#8217;s a very useful software, used by many dynamic <a href="http://www.technopagan.org/dynamic/">DNS providers</a>.<br />
I&#8217;ve used it at <a href="http://www.easter-eggs.com/">work</a> for many projects, because is very easy to manage DNS records with it. But this time we needed to secure dynamic DNS updates.</p>
<h3>TSIG</h3>
<p>This protocol allows for transaction level authentication using shared secrets and one way hashing (with the <a href="http://en.wikipedia.org/wiki/HMAC">HMAC-MD5</a> algorithm).<br />
It can be used to authenticate dynamic updates as coming from an approved client or to authenticate<br />
responses as coming from an approved recursive name server.<br />
It&#8217;s an easy and strong authentication method, simpler than <a href="http://en.wikipedia.org/wiki/DNSSEC">DNSSEC</a>.<br />
If you want more informations about Dynamic DNS Updates with TSIG and Security,  please read this <a href="http://www.lesbell.com.au/Home.nsf/0/3f0a77f02a05e665ca256bee00104c74?OpenDocument">document</a>.</p>
<h3>Installation</h3>
<p>Download and extract the source code of MyDNS version 1.1.0 at <a href="http://mydns.bboy.net/download/">http://mydns.bboy.net/download</a> :</p>
<p><code><br />
$ wget http://mydns.bboy.net/download/mydns-1.1.0.tar.gz<br />
$ tar xzf mydns-1.1.0.tar.gz<br />
</code></p>
<p>Download and apply my patch : <a href="http://www.csquad.org/wp-content/contrib/mydns-1.1.0-tsig.patch">http://www.csquad.org/wp-content/contrib/mydns-1.1.0-tsig.patch</a></p>
<p><code><br />
$ cd mydns-1.1.0<br />
$ wget http://www.csquad.org/wp-content/contrib/mydns-1.1.0-tsig.patch<br />
$ patch -p1 < mydns-1.1.0-tsig.patch<br />
</code></p>
<h3>Build process</h3>
<p>You need to build the program with OpenSSL support :<br />
</code><code><br />
$ ./configure --with-openssl<br />
$ make<br />
# make install<br />
</code></p>
<h3>Database setup</h3>
<p>To create database structure use the &#8216;&#8211;create-table&#8217; option :<br />
<code><br />
$ mydns --create-table | mysql<br />
</code><br />
Transaction Keys are stored in the &#8216;dnskey&#8217; table and the name of the key.<br />
Keyname allowed to update an record are stored in column &#8216;update_key&#8217; of the &#8217;soa&#8217; table.</p>
<p>You can generate you own key with dnssec-keygen tool :<br />
<code><br />
$ dnssec-keygen  -a HMAC-MD5 -b 128 -n HOST client.domain.com<br />
</code></p>
<p>Insert the value of this key in the &#8216;dnskey&#8217; table :<br />
<code><br />
mydns>  INSERT INTO dnskey (name, algorithm, size, type, private) VALUES<br />
                   ('client.domain.com', 'HMAC-MD5', 128, 'HOST', 'IYrqgYuJaTkL2Xs34GZ7+w==');<br />
</code></p>
<p>Add the &#8216;update_acl&#8217; column in the &#8217;soa&#8217; table :<br />
<code><br />
mydns> ALTER TABLE `soa` ADD `update_key` VARCHAR( 255 ) ;<br />
</code></p>
<p>Assign the update key to an DNS entry :<br />
<code><br />
mydns> UPDATE soa SET update_key = 'client.domain.com' WHERE origin='domain.com.';<br />
</code><br />
Restart the MyDNS server and check if the optional column &#8216;update_key&#8217; was found :<br />
<code><br />
    # mydns -v<br />
    ...<br />
    mydns: optional 'update_key' column found in 'soa' table<br />
    ...<br />
</code></p>
<h3>Usage</h3>
<p>Update an domain entry with the nsupdate client :<br />
<code><br />
$ nsupdate -d -y client.domain.com:IYrqgYuJaTkL2Xs34GZ7+w==<br />
> server ns.domain.com<br />
> zone domain.com<br />
> update add entry.domain.com 60 A 192.168.0.1<br />
> send<br />
</code></p>
<h3>Conculsion</h3>
<p>The full RFC in not totaly implanted, thoses features are missing :</p>
<ul>
<li>TCP support, I&#8217;am not an expert of the DNS protocol and I dont fully understand TCP usage and message chunking.</li>
<li>Authentication of responses from an approved recursive name server.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.csquad.org/2006/03/14/dns-secret-key-transaction-authentication-tsig-support-for-mydns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

