<?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>Long-term Memory &#187; DNS</title>
	<atom:link href="http://blog.dest-unreach.be/tag/dns/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.dest-unreach.be</link>
	<description>A collection of note-to-self&#039;s</description>
	<lastBuildDate>Sun, 29 Jan 2012 16:05:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>World IPv6 day &#8211; lessons learned</title>
		<link>http://blog.dest-unreach.be/2011/06/14/world-ipv6-day-lessons-learned</link>
		<comments>http://blog.dest-unreach.be/2011/06/14/world-ipv6-day-lessons-learned#comments</comments>
		<pubDate>Tue, 14 Jun 2011 12:22:26 +0000</pubDate>
		<dc:creator>Niobos</dc:creator>
				<category><![CDATA[Networking & Security]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Ethernet]]></category>
		<category><![CDATA[IPsec]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MacOSX]]></category>

		<guid isPermaLink="false">http://blog.dest-unreach.be/?p=2032</guid>
		<description><![CDATA[Together with most of the internet, we tested IPv6 on World IPv6 day last week. I won&#8217;t go into details on what IPv6 is and why it&#8217;s important. Although IPv6 has been tested intensely in isolated networks, this is the first time it was tested on such a large scale. Technically, the participants would just [...]]]></description>
			<content:encoded><![CDATA[<p>Together with <a href="http://googleblog.blogspot.com/2011/01/world-ipv6-day-firing-up-engines-on-new.html">most</a> <a href="http://www.facebook.com/notes/facebook-engineering/world-ipv6-day-solving-the-ip-address-chicken-and-egg-challenge/484445583919">of</a> <a href="http://www.yahoo.com/">the</a> <a href="http://www.akamai.com/ipv6">internet</a>, we tested IPv6 on <a href="http://www.worldipv6day.org/">World IPv6 day</a> last week. I won&#8217;t go into details on what <a href="http://en.wikipedia.org/wiki/IPv6">IPv6</a> is and why it&#8217;s <a href="http://en.wikipedia.org/wiki/IPv6#Motivation_and_origins">important</a>. Although IPv6 has been tested intensely in isolated networks, this is the first time it was tested on such a large scale. Technically, the participants would just add <a href="http://en.wikipedia.org/wiki/IPv6_address#IPv6_addresses_in_the_Domain_Name_System">AAAA-records</a> for their websites to <a href="http://en.wikipedia.org/wiki/Domain_Name_System">DNS</a>. This small change causes a huge effect. Since most browsers are configured to prefer IPv6 AAAA-records over IPv4 A-records, this causes all IPv6-connected users to suddenly connect over IPv6 instead of IPv4.</p>
<p>For the most part, this major changeover happened without as much of a hitch. In fact, if I hadn&#8217;t known it was World IPv6 day, I wouldn&#8217;t have noticed anything. But I&#8217;m not a normal web-user, so I did notice some issues.</p>
<h3><span id="more-2032"></span>Where it did went wrong</h3>
<p>After some troubleshooting, they all boiled down to a single cause of oversight. They were not bugs or issues with IPv6 per se, just some &#8220;expected behavior&#8221; that we didn&#8217;t anticipate: IPv4-only VPNs.</p>
<p>Most servers in our datacenter are not publicly accessible; none of them are manageable over the public internet. In order to connect to them, you need a <a href="http://en.wikipedia.org/wiki/Virtual_private_network">VPN</a> connection. This serves multiple purposes: it secures all communication between client and server (so even plain-text http can be used securely to manage servers), it limits the number of users with access and most importantly (in the IPv4 world) it allows us to use <a href="http://www.apps.ietf.org/rfc/rfc1918.html">RFC1918 addresses</a> internally and still get the routing to work out. Technically it behaves an an extra (virtual) network card with a (virtual) cable connected straight to the datacenter. Additionally, some routes are configured automatically on the client to make sure traffic to the servers is sent over this &#8220;cable&#8221;.</p>
<p>We use two kinds of VPN-connections, but none of them was IPv6 enabled (i.e. could carry IPv6 data through the tunnel). Since by default client software prefers IPv6 connections, this caused the IPv6-internet connection to be preferred above the IPv4-VPN connection. Obviously, the firewall at the datacenter didn&#8217;t agree and refused access.</p>
<p>The solution was fairly obvious to state (enable IPv6 through the tunnels) but difficult to implement. In fact, I have not been able to get it to work well enough to install it on someone else&#8217;s computer.</p>
<h3>The attempts</h3>
<h4>IPsec in transport mode</h4>
<p>The &#8220;natural&#8221; solution would be to secure the IPv6 packets with <a href="http://en.wikipedia.org/wiki/IPsec">IPsec</a>, preferably in <a href="http://en.wikipedia.org/wiki/IPsec#Transport_mode">transport mode</a>, between the client and the firewall. Since there are no <a href="http://en.wikipedia.org/wiki/Network_address_translation">NAT</a>-issues, <a href="http://en.wikipedia.org/wiki/IPsec#Tunnel_mode">tunnel mode</a> is not required.</p>
<p><img class="alignnone size-full wp-image-2034" title="Network diagram" src="http://blog.dest-unreach.be/wp-content/uploads/2011/06/server-fw-client.png" alt="network diagram:  server (2001:db8:0:1::1) — (2001:db8:0:1::2) Firewall (2001:db8:1:0::2) — (2001:db8:1:1::3) client" width="700" height="143" /></p>
<p>However, I was not able to get this to work, even in manual keying mode (i.e. without <a href="http://en.wikipedia.org/wiki/Internet_Security_Association_and_Key_Management_Protocol">ISAKMP</a>). I couldn&#8217;t get <em>setkey</em> to accept the <em>src-dst</em> parameter in the SPD:</p>
<blockquote>
<pre># setkey -c
spdadd 2001:db8:0:1::1 2001:db8:1:1::3 any -P fwd ipsec esp/transport/2001:db8:1:0:2-2001:db8:1:1::3/require;
<em>^D</em>
# setkey -DP
2001:db8:0:1::1[any] 2001:db8:1:1::3[any] any
 fwd prio def ipsec
 esp/transport//require
 created: Jun 14 12:13:53 2011  lastused:                    
 lifetime: 0(s) validtime: 0(s)
 spid=1641 seq=1 pid=10485
 refcnt=1</pre>
</blockquote>
<p>This seems to be a Linux issue (Ubuntu 10.04 LTS with kernel 2.6.32-28-generic and ipsec-tools 0.7.1), since this does work on MacOSX (10.6.7).</p>
<h4>IPsec tunnel mode</h4>
<p>Since I&#8217;m not entirely sure that what I tried above (transport mode) is even supposed to work, I also tried tunnel mode. This worked, but is a pain to configure. I only tried manual keying, but using racoon to do username/password authentication will be even harder to explain to users…</p>
<p>The Mac built-in VPN client only supports &#8220;<a href="/2011/03/03/iphone-compatible-ipsec-vpn-on-an-ubuntu-server-with-ldap-authentication">Cisco IPsec</a>&#8220;. This uses the mode configuration stage to communicate the set of &#8220;networks&#8221; to tunnel (i.e. the SPD). However, according to <a href="http://netbsd.gw.com/cgi-bin/man-cgi?racoon.conf+5+NetBSD-current">racoon.conf man-page</a>, I can only push IPv4 networks in the <em>split_network</em> directive.</p>
<h4>OpenVPN with tun driver</h4>
<p>According to the <a href="http://openvpn.net/index.php/open-source/faq/77-server/287-is-ipv6-support-plannedin-the-works.html">OpenVPN FAQ</a>, IPv6 is only supported if the underlying <a href="http://en.wikipedia.org/wiki/TUN/TAP">TUN-driver</a> supports it. The <a href="http://tuntaposx.sourceforge.net/">tuntaposx-page</a> does not mention IPv6 at all and hasn&#8217;t been updated for almost 2 years, so this seems unlikely to work.</p>
<p>Also, OpenVPN does not provide configuration directives to push IPv6 routes over from server to client.</p>
<h4>OpenVPN with tap driver</h4>
<p>Even when using the TAP-driver and <a href="http://en.wikipedia.org/wiki/IPv6#Stateless_address_autoconfiguration_.28SLAAC.29">router advertisements</a>, MacOSX does not seem to like enabling IPv6… Even after manually enabling it, MacOSX still doesn&#8217;t pick up its SLAAC address:</p>
<blockquote>
<pre># ifconfig tap0
tap0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
 ether 7e:95:80:00:90:0e
 inet 192.0.2.10 netmask 0xffffff00 broadcast 10.90.9.255
 open (pid 3847)

# ip6config start-v6 tap0
Starting IPv6 on tap0.

# sleep 60 # Wait for Router advertisement to show up

# ifconfig tap0
tap0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
 ether 7e:95:80:00:90:0e
 inet 192.0.2.10 netmask 0xffffff00 broadcast 10.90.9.255
 inet6 fe80::7c95:80ff:fe00:900e%tap0 prefixlen 64 tentative scopeid 0xa
 open (pid 3847)</pre>
</blockquote>
<p>And this still doesn&#8217;t allow me to push IPv6 routes to the clients upon connecting.</p>
<h3>The conclusion</h3>
<p>IPv6 is very stable and capable, but there are certain network-issues where there is still some work to do. If you happen to know a VPN-solution which supports IPv6 and works on Windows, linux and Mac, please let me know!</p>
<p>Edit: I <a href="/2011/06/27/configuring-openvpn-to-support-ipv6">worked out my own solution</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dest-unreach.be/2011/06/14/world-ipv6-day-lessons-learned/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using nsupdate in dd-wrt</title>
		<link>http://blog.dest-unreach.be/2010/12/06/using-nsupdate-in-dd-wrt</link>
		<comments>http://blog.dest-unreach.be/2010/12/06/using-nsupdate-in-dd-wrt#comments</comments>
		<pubDate>Mon, 06 Dec 2010 18:17:06 +0000</pubDate>
		<dc:creator>Niobos</dc:creator>
				<category><![CDATA[Networking & Security]]></category>
		<category><![CDATA[dd-wrt]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://blog.dest-unreach.be/?p=1954</guid>
		<description><![CDATA[dd-wrt has built-in support for a whole list of Dynamic DNS services. Unfortunately, they only support HTTP-based services. I use a standard RFC2136 DNS update. Here&#8217;s how to add nsupdate support to dd-wrt. Installing I again used the openwrt modules, nsupdate is contained within bind-client. There are, however, several dependencies: libbind9.so.40.0.3, libdns.so.43.0.0, libisc.so.41.1.0, libisccc.so.40.0.0, libisccfg.so.40.0.3, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.dd-wrt.com/wiki/index.php/What_is_DD-WRT%3F">dd-wrt</a> has built-in support for a whole list of <a href="http://en.wikipedia.org/wiki/Dynamic_DNS">Dynamic DNS</a> services. Unfortunately, they only support HTTP-based services. I use a standard <a href="http://tools.ietf.org/html/rfc2136">RFC2136</a> DNS update. Here&#8217;s how to add <a href="http://en.wikipedia.org/wiki/Nsupdate">nsupdate</a> support to dd-wrt.</p>
<h3><span id="more-1954"></span>Installing</h3>
<p>I again used the <a href="http://downloads.openwrt.org/kamikaze/8.09.2/brcm47xx/packages/">openwrt modules</a>, <em>nsupdate</em> is contained within <a href="http://downloads.openwrt.org/kamikaze/8.09.2/brcm47xx/packages/bind-client_9.5.0-P1-1.1_mipsel.ipk">bind-client</a>. There are, however, several dependencies:</p>
<ul>
<li><em>libbind9.so.40.0.3</em>, <em>libdns.so.43.0.0</em>, <em>libisc.so.41.1.0</em>, <em>libisccc.so.40.0.0</em>, <em>libisccfg.so.40.0.3</em>, <em>liblwres.so.40.0.0</em> (and symlinks) from <a href="http://downloads.openwrt.org/kamikaze/8.09.2/brcm47xx/packages/bind-libs_9.5.0-P1-1.1_mipsel.ipk">bind-libs</a></li>
<li><em>libcrypto.so.0.9.8</em> from <a href="http://downloads.openwrt.org/kamikaze/8.09.2/brcm47xx/packages/libopenssl_0.9.8i-3.2_mipsel.ipk">libopenssl</a></li>
</ul>
<p>These are some serious libraries, takeing up 2.7MB of free space…</p>
<h3>Configuring</h3>
<p>I tried to use <a href="http://tools.ietf.org/html/rfc2137#section-4">SIG(0)</a>, but that failed. <em>nsupdate</em> complains about a missing symbol &#8216;flockfile&#8217;. So I settled for <a href="http://en.wikipedia.org/wiki/TSIG">TSIG</a> authentication. Since this is a post about dd-wrt, I&#8217;ll assume the sever is already set up and tested (<a href="http://www.ops.ietf.org/dns/dynupd/secure-ddns-howto.html">this</a> will guide you through if it&#8217;s not), so I&#8217;ll go straight to the config files:</p>
<p><em>/jffs/etc/ddns.key</em>:</p>
<blockquote>
<pre>fqdn.of.key. 0huPr3nqFnxUETlrM/VxGg==</pre>
</blockquote>
<p><em>/jffs/etc/config/ddns-update.wanup</em>:</p>
<blockquote>
<pre>#!/bin/sh

# wanup scripts seem to run without LD_LIBRARY_PATH set
export LD_LIBRARY_PATH='/lib:/usr/lib:/jffs/lib:/jffs/usr/lib:/jffs/usr/local/lib:/mmc/lib:/mmc/usr/lib:/opt/lib:/opt/usr/lib'

# wanup scripts have the IPLOCAL variable set, but cron does not
if [ -z "$IPLOCAL" ]; then
 IPLOCAL=`ip addr sh dev ppp0 | grep 'inet ' | cut '-d ' -f6`
fi

sleep 30 # wait for IPv6, DNS, … to stabilize

echo -e "server ddns.master.server.fqdn\nkey `cat /jffs/etc/ddns.key`\n
update delete fqdn.to.set A\nupdate delete fqdn.te.set TXT\n
update add fqdn.to.set 300 A $IPLOCAL\nupdate add fqdn.to.set 300 TXT `date "+%Y-%m-%d_%H:%M:%S"`\n
send" | /jffs/bin/nsupdate
</pre>
</blockquote>
<p>I cut that last echo-line into pieces for readability, make sure that it&#8217;s one single line (from <em>echo</em> all the way to <em>nsupdate</em>).</p>
<p>I added the following line to the <em>Additional cron jobs</em> on the webinterface. Contrary to the <a href="http://www.dd-wrt.com/wiki/index.php/CRON">dd-wrt wiki page</a>, <em>/jffs/etc/crontab</em> does not seem to work. This will run the <em>ddns-update</em> script every hour, at 5 minutes past the hour:</p>
<blockquote>
<pre>5 * * * *  root  /jffs/etc/config/ddns-update.wanup
</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.dest-unreach.be/2010/12/06/using-nsupdate-in-dd-wrt/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DNS(SEC) &#8211; Firewall issues</title>
		<link>http://blog.dest-unreach.be/2010/02/10/dnssec-firewall-issues</link>
		<comments>http://blog.dest-unreach.be/2010/02/10/dnssec-firewall-issues#comments</comments>
		<pubDate>Wed, 10 Feb 2010 18:03:25 +0000</pubDate>
		<dc:creator>Niobos</dc:creator>
				<category><![CDATA[Networking & Security]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[dnssec]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[NAT]]></category>

		<guid isPermaLink="false">http://blog.dest-unreach.be/?p=1630</guid>
		<description><![CDATA[I just read this message by Mark Andrews on the BIND mailing list. It explains the possible issues with DNSSEC and over-protective firewalls, giving test-commands to verify your setup. This post is also interesting for regular DNS traffic, since a firewall doesn&#8217;t know the difference. Here is the most interesting part: First, you should verify [...]]]></description>
			<content:encoded><![CDATA[<p>I just read <a href="https://lists.isc.org/pipermail/bind-users/2010-February/078755.html">this message</a> by Mark Andrews on the <a href="https://lists.isc.org/mailman/listinfo/bind-users">BIND mailing list</a>. It explains the possible issues with DNSSEC and over-protective firewalls, giving test-commands to verify your setup. This post is also interesting for regular DNS traffic, since a firewall doesn&#8217;t know the difference.</p>
<p><span id="more-1630"></span> Here is the most interesting part:</p>
<blockquote><p>First, you should verify that you can talk to L.ROOT-SERVERS.NET using plain DNS.  This will ensure that failures in the subsequent tests are meaningful.</p>
<p>e.g.</p>
<pre>dig +nodnssec +norec +ignore ns . @L.ROOT-SERVERS.NET

; &lt;&lt;&gt;&gt; DiG 9.3.6-P1 &lt;&lt;&gt;&gt; +nodnssec +norec +ignore ns . @L.ROOT-SERVERS.NET
;; global options:  printcmd
;; Got answer:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 39974
;; flags: qr aa; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 15

;; QUESTION SECTION:
;.				IN	NS

;; ANSWER SECTION:
.			518400	IN	NS	a.root-servers.net.
.			518400	IN	NS	b.root-servers.net.
.			518400	IN	NS	c.root-servers.net.
.			518400	IN	NS	d.root-servers.net.
.			518400	IN	NS	e.root-servers.net.
.			518400	IN	NS	f.root-servers.net.
.			518400	IN	NS	g.root-servers.net.
.			518400	IN	NS	h.root-servers.net.
.			518400	IN	NS	i.root-servers.net.
.			518400	IN	NS	j.root-servers.net.
.			518400	IN	NS	k.root-servers.net.
.			518400	IN	NS	l.root-servers.net.
.			518400	IN	NS	m.root-servers.net.

;; ADDITIONAL SECTION:
a.root-servers.net.	518400	IN	A	198.41.0.4
b.root-servers.net.	518400	IN	A	192.228.79.201
c.root-servers.net.	518400	IN	A	192.33.4.12
d.root-servers.net.	518400	IN	A	128.8.10.90
e.root-servers.net.	518400	IN	A	192.203.230.10
f.root-servers.net.	518400	IN	A	192.5.5.241
g.root-servers.net.	518400	IN	A	192.112.36.4
h.root-servers.net.	518400	IN	A	128.63.2.53
i.root-servers.net.	518400	IN	A	192.36.148.17
j.root-servers.net.	518400	IN	A	192.58.128.30
k.root-servers.net.	518400	IN	A	193.0.14.129
l.root-servers.net.	518400	IN	A	199.7.83.42
m.root-servers.net.	518400	IN	A	202.12.27.33
a.root-servers.net.	518400	IN	AAAA	2001:503:ba3e::2:30
f.root-servers.net.	518400	IN	AAAA	2001:500:2f::f

;; Query time: 189 msec
;; SERVER: 2001:500:3::42#53(2001:500:3::42)
;; WHEN: Mon Feb  8 13:05:49 2010
;; MSG SIZE  rcvd: 492</pre>
<p>Next we will see whether you can receive an answer that is greater than 512 bytes.  This test simulates how named makes its initial queries. Most signed responses fit between 512 bytes and 1500 bytes and are returned in a single un-fragmented UDP packet.  This test is designed to check this case.</p>
<p>e.g.</p>
<pre>dig +dnssec +norec +ignore ns . @L.ROOT-SERVERS.NET

; &lt;&lt;&gt;&gt; DiG 9.3.6-P1 &lt;&lt;&gt;&gt; +dnssec +norec +ignore ns . @L.ROOT-SERVERS.NET
;; global options:  printcmd
;; Got answer:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 381
;; flags: qr aa; QUERY: 1, ANSWER: 14, AUTHORITY: 0, ADDITIONAL: 21

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;.				IN	NS

;; ANSWER SECTION:
.			518400	IN	NS	a.root-servers.net.
.			518400	IN	NS	b.root-servers.net.
.			518400	IN	NS	c.root-servers.net.
.			518400	IN	NS	d.root-servers.net.
.			518400	IN	NS	e.root-servers.net.
.			518400	IN	NS	f.root-servers.net.
.			518400	IN	NS	g.root-servers.net.
.			518400	IN	NS	h.root-servers.net.
.			518400	IN	NS	i.root-servers.net.
.			518400	IN	NS	j.root-servers.net.
.			518400	IN	NS	k.root-servers.net.
.			518400	IN	NS	l.root-servers.net.
.			518400	IN	NS	m.root-servers.net.
.			518400	IN	RRSIG	NS 8 0 518400 20100214000000 20100206230000 23763 . JWEPSBVBz37WV/cvjxtlBGGLFe88ojhBM3ZZW+ZC2umpQq5lMSnE/3vO WGVWq8gOFs/mlmXttk80WxwZfUvgDXddNtqbNoNWZaGPbH9F2O+B6yDX n6jE4EcMRcjoL752uZTDMZ8WHEiEorjxsVYr1ae1MYZO5K0CqzX/qkUW 1DY=

;; ADDITIONAL SECTION:
a.root-servers.net.	518400	IN	A	198.41.0.4
b.root-servers.net.	518400	IN	A	192.228.79.201
c.root-servers.net.	518400	IN	A	192.33.4.12
d.root-servers.net.	518400	IN	A	128.8.10.90
e.root-servers.net.	518400	IN	A	192.203.230.10
f.root-servers.net.	518400	IN	A	192.5.5.241
g.root-servers.net.	518400	IN	A	192.112.36.4
h.root-servers.net.	518400	IN	A	128.63.2.53
i.root-servers.net.	518400	IN	A	192.36.148.17
j.root-servers.net.	518400	IN	A	192.58.128.30
k.root-servers.net.	518400	IN	A	193.0.14.129
l.root-servers.net.	518400	IN	A	199.7.83.42
m.root-servers.net.	518400	IN	A	202.12.27.33
a.root-servers.net.	518400	IN	AAAA	2001:503:ba3e::2:30
f.root-servers.net.	518400	IN	AAAA	2001:500:2f::f
h.root-servers.net.	518400	IN	AAAA	2001:500:1::803f:235
j.root-servers.net.	518400	IN	AAAA	2001:503:c27::2:30
k.root-servers.net.	518400	IN	AAAA	2001:7fd::1
l.root-servers.net.	518400	IN	AAAA	2001:500:3::42
m.root-servers.net.	518400	IN	AAAA	2001:dc3::35

;; Query time: 191 msec
;; SERVER: 2001:500:3::42#53(2001:500:3::42)
;; WHEN: Mon Feb  8 12:51:28 2010
;; MSG SIZE  rcvd: 801</pre>
<p>If you get a response like this then your firewall passes UDP responses greater than 512 bytes.</p>
<p>If you did not get a response like this, you need to fix your firewall.</p>
<p>Next we will test to see whether you can get a response greater than 1500 bytes.  Such responses are normally fragmented, and this test will find out whether your firewall will pass fragmented UDP packets. Failure to pass such responses will force named to fall back to using queries which are likely to trigger the use of TCP, which should be avoided.  Failure to pass such answers will also slow up the resolution process.</p>
<p>e.g.</p>
<pre>dig +dnssec +norec +ignore any . @L.ROOT-SERVERS.NET

; &lt;&lt;&gt;&gt; DiG 9.3.6-P1 &lt;&lt;&gt;&gt; +dnssec +norec +ignore any . @L.ROOT-SERVERS.NET
;; global options:  printcmd
;; Got answer:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 57084
;; flags: qr aa; QUERY: 1, ANSWER: 21, AUTHORITY: 0, ADDITIONAL: 21

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;.				IN	ANY

;; ANSWER SECTION:
.			86400	IN	NSEC	ac. NS SOA RRSIG NSEC DNSKEY
.			86400	IN	RRSIG	NSEC 8 0 86400 20100214000000 20100206230000 23763 . haTtgLwOQ9Bm2F9BRqMtAzahIuUWrjcmRjFGI5s5jGUVpjgq/MOl7wRi IJ1nLQkXThzc8hn6b3faXXIhHE/8MShzOG4wFbHwJyltx8IT9E8XP4P5 Fz9TuE3EEElNE6GZNAg8UM4r8hyv/PSM8e7offdh7pg32kfW6fgoLsHy 8yQ=
.			86400	IN	DNSKEY	256 3 8 AwEAAa1Lh++++++++++++++++THIS/IS/AN/INVALID/KEY/AND/SHOU LD/NOT/BE/USED/CONTACT/ROOTSIGN/AT/ICANN/DOT/ORG/FOR/MOR E/INFORMATION+++++++++++++++++++++++++++++++++++++++++++ +++++++8
.			86400	IN	DNSKEY	257 3 8 AwEAAawBe++++++++++++++++THIS/IS/AN/INVALID/KEY/AND/SHOU LD/NOT/BE/USED/CONTACT/ROOTSIGN/AT/ICANN/DOT/ORG/FOR/MOR E/INFORMATION+++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++8=
.			86400	IN	RRSIG	DNSKEY 8 0 86400 20100214235959 20100131000000 19324 . v2DVoP16w3dqsOooCxAb393ExF6p1t3d3qJsYPkeV96/t3HIuVLnxpbV 02Wx+BR7dwLiURASmebvEhZrR4gNqO15M5gerrzDdY0IXA0q0xVAUj/J NvkdiniXjoQYGUwjJsdfqxvD7NQPtSz4YTuOvMlVffV1F2Bc6Woid7AK JGkb24MeQlAMy/gQqcLPs6c3a9RvZEwofMul66bUswGS+YsL8x9A6Cbt 1bdyhRUNYSl7AifA4++Pu+0MLpbrxH7DLI8O9ZfCA3LsEQUOFjYA+2jJ mzgFqZAU0HvxeQyStnLF3/bf7qifRegrn6+cTKjKtUZ52/kUFiaqgT2t 9TemTg==
.			518400	IN	NS	a.root-servers.net.
.			518400	IN	NS	b.root-servers.net.
.			518400	IN	NS	c.root-servers.net.
.			518400	IN	NS	d.root-servers.net.
.			518400	IN	NS	e.root-servers.net.
.			518400	IN	NS	f.root-servers.net.
.			518400	IN	NS	g.root-servers.net.
.			518400	IN	NS	h.root-servers.net.
.			518400	IN	NS	i.root-servers.net.
.			518400	IN	NS	j.root-servers.net.
.			518400	IN	NS	k.root-servers.net.
.			518400	IN	NS	l.root-servers.net.
.			518400	IN	NS	m.root-servers.net.
.			518400	IN	RRSIG	NS 8 0 518400 20100214000000 20100206230000 23763 . JWEPSBVBz37WV/cvjxtlBGGLFe88ojhBM3ZZW+ZC2umpQq5lMSnE/3vO WGVWq8gOFs/mlmXttk80WxwZfUvgDXddNtqbNoNWZaGPbH9F2O+B6yDX n6jE4EcMRcjoL752uZTDMZ8WHEiEorjxsVYr1ae1MYZO5K0CqzX/qkUW 1DY=
.			86400	IN	SOA	a.root-servers.net. nstld.verisign-grs.com. 2010020701 1800 900 604800 86400
.			86400	IN	RRSIG	SOA 8 0 86400 20100214000000 20100206230000 23763 . KA46XFSIJT3xKdvlo2av5FmeFl5R8etArvA9PLJb4JUz2jioqYTjhDbT 6L5kJQaiavMF1Lic5spulaHlCHmVy+gLetI49Nc8htnd0QPWTn/MG3do isDlv9nh6uCR6cJj5W/anIkubiLHBmO11QLwVNa1IybTgTCKHNwefxG0 i/M=

;; ADDITIONAL SECTION:
a.root-servers.net.	518400	IN	A	198.41.0.4
b.root-servers.net.	518400	IN	A	192.228.79.201
c.root-servers.net.	518400	IN	A	192.33.4.12
d.root-servers.net.	518400	IN	A	128.8.10.90
e.root-servers.net.	518400	IN	A	192.203.230.10
f.root-servers.net.	518400	IN	A	192.5.5.241
g.root-servers.net.	518400	IN	A	192.112.36.4
h.root-servers.net.	518400	IN	A	128.63.2.53
i.root-servers.net.	518400	IN	A	192.36.148.17
j.root-servers.net.	518400	IN	A	192.58.128.30
k.root-servers.net.	518400	IN	A	193.0.14.129
l.root-servers.net.	518400	IN	A	199.7.83.42
m.root-servers.net.	518400	IN	A	202.12.27.33
a.root-servers.net.	518400	IN	AAAA	2001:503:ba3e::2:30
f.root-servers.net.	518400	IN	AAAA	2001:500:2f::f
h.root-servers.net.	518400	IN	AAAA	2001:500:1::803f:235
j.root-servers.net.	518400	IN	AAAA	2001:503:c27::2:30
k.root-servers.net.	518400	IN	AAAA	2001:7fd::1
l.root-servers.net.	518400	IN	AAAA	2001:500:3::42
m.root-servers.net.	518400	IN	AAAA	2001:dc3::35

;; Query time: 191 msec
;; SERVER: 2001:500:3::42#53(2001:500:3::42)
;; WHEN: Mon Feb  8 13:15:19 2010
;; MSG SIZE  rcvd: 1906</pre>
<p>If you get a reponse like this then your firewall passes UDP responses greater than 1500 bytes.</p>
<p>If you did not get a response like this, you need to fix your firewall.</p>
<p>Next we need to see whether your firewall passes outbound TCP queries. Even when using EDNS, some answers will not fit into a UDP packet. Such responses require queries to be performed over TCP.</p>
<p>e.g.</p>
<pre>dig +dnssec +norec +vc any . @L.ROOT-SERVERS.NET

; &lt;&lt;&gt;&gt; DiG 9.3.6-P1 &lt;&lt;&gt;&gt; +dnssec +norec +vc any . @L.ROOT-SERVERS.NET
;; global options:  printcmd
;; Got answer:
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 20036
;; flags: qr aa; QUERY: 1, ANSWER: 21, AUTHORITY: 0, ADDITIONAL: 21

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;.				IN	ANY

;; ANSWER SECTION:
.			86400	IN	NSEC	ac. NS SOA RRSIG NSEC DNSKEY
.			86400	IN	RRSIG	NSEC 8 0 86400 20100214000000 20100206230000 23763 . haTtgLwOQ9Bm2F9BRqMtAzahIuUWrjcmRjFGI5s5jGUVpjgq/MOl7wRi IJ1nLQkXThzc8hn6b3faXXIhHE/8MShzOG4wFbHwJyltx8IT9E8XP4P5 Fz9TuE3EEElNE6GZNAg8UM4r8hyv/PSM8e7offdh7pg32kfW6fgoLsHy 8yQ=
.			86400	IN	DNSKEY	256 3 8 AwEAAa1Lh++++++++++++++++THIS/IS/AN/INVALID/KEY/AND/SHOU LD/NOT/BE/USED/CONTACT/ROOTSIGN/AT/ICANN/DOT/ORG/FOR/MOR E/INFORMATION+++++++++++++++++++++++++++++++++++++++++++ +++++++8
.			86400	IN	DNSKEY	257 3 8 AwEAAawBe++++++++++++++++THIS/IS/AN/INVALID/KEY/AND/SHOU LD/NOT/BE/USED/CONTACT/ROOTSIGN/AT/ICANN/DOT/ORG/FOR/MOR E/INFORMATION+++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++8=
.			86400	IN	RRSIG	DNSKEY 8 0 86400 20100214235959 20100131000000 19324 . v2DVoP16w3dqsOooCxAb393ExF6p1t3d3qJsYPkeV96/t3HIuVLnxpbV 02Wx+BR7dwLiURASmebvEhZrR4gNqO15M5gerrzDdY0IXA0q0xVAUj/J NvkdiniXjoQYGUwjJsdfqxvD7NQPtSz4YTuOvMlVffV1F2Bc6Woid7AK JGkb24MeQlAMy/gQqcLPs6c3a9RvZEwofMul66bUswGS+YsL8x9A6Cbt 1bdyhRUNYSl7AifA4++Pu+0MLpbrxH7DLI8O9ZfCA3LsEQUOFjYA+2jJ mzgFqZAU0HvxeQyStnLF3/bf7qifRegrn6+cTKjKtUZ52/kUFiaqgT2t 9TemTg==
.			518400	IN	NS	a.root-servers.net.
.			518400	IN	NS	b.root-servers.net.
.			518400	IN	NS	c.root-servers.net.
.			518400	IN	NS	d.root-servers.net.
.			518400	IN	NS	e.root-servers.net.
.			518400	IN	NS	f.root-servers.net.
.			518400	IN	NS	g.root-servers.net.
.			518400	IN	NS	h.root-servers.net.
.			518400	IN	NS	i.root-servers.net.
.			518400	IN	NS	j.root-servers.net.
.			518400	IN	NS	k.root-servers.net.
.			518400	IN	NS	l.root-servers.net.
.			518400	IN	NS	m.root-servers.net.
.			518400	IN	RRSIG	NS 8 0 518400 20100214000000 20100206230000 23763 . JWEPSBVBz37WV/cvjxtlBGGLFe88ojhBM3ZZW+ZC2umpQq5lMSnE/3vO WGVWq8gOFs/mlmXttk80WxwZfUvgDXddNtqbNoNWZaGPbH9F2O+B6yDX n6jE4EcMRcjoL752uZTDMZ8WHEiEorjxsVYr1ae1MYZO5K0CqzX/qkUW 1DY=
.			86400	IN	SOA	a.root-servers.net. nstld.verisign-grs.com. 2010020701 1800 900 604800 86400
.			86400	IN	RRSIG	SOA 8 0 86400 20100214000000 20100206230000 23763 . KA46XFSIJT3xKdvlo2av5FmeFl5R8etArvA9PLJb4JUz2jioqYTjhDbT 6L5kJQaiavMF1Lic5spulaHlCHmVy+gLetI49Nc8htnd0QPWTn/MG3do isDlv9nh6uCR6cJj5W/anIkubiLHBmO11QLwVNa1IybTgTCKHNwefxG0 i/M=

;; ADDITIONAL SECTION:
a.root-servers.net.	518400	IN	A	198.41.0.4
b.root-servers.net.	518400	IN	A	192.228.79.201
c.root-servers.net.	518400	IN	A	192.33.4.12
d.root-servers.net.	518400	IN	A	128.8.10.90
e.root-servers.net.	518400	IN	A	192.203.230.10
f.root-servers.net.	518400	IN	A	192.5.5.241
g.root-servers.net.	518400	IN	A	192.112.36.4
h.root-servers.net.	518400	IN	A	128.63.2.53
i.root-servers.net.	518400	IN	A	192.36.148.17
j.root-servers.net.	518400	IN	A	192.58.128.30
k.root-servers.net.	518400	IN	A	193.0.14.129
l.root-servers.net.	518400	IN	A	199.7.83.42
m.root-servers.net.	518400	IN	A	202.12.27.33
a.root-servers.net.	518400	IN	AAAA	2001:503:ba3e::2:30
f.root-servers.net.	518400	IN	AAAA	2001:500:2f::f
h.root-servers.net.	518400	IN	AAAA	2001:500:1::803f:235
j.root-servers.net.	518400	IN	AAAA	2001:503:c27::2:30
k.root-servers.net.	518400	IN	AAAA	2001:7fd::1
l.root-servers.net.	518400	IN	AAAA	2001:500:3::42
m.root-servers.net.	518400	IN	AAAA	2001:dc3::35

;; Query time: 380 msec
;; SERVER: 2001:500:3::42#53(2001:500:3::42)
;; WHEN: Mon Feb  8 13:18:19 2010
;; MSG SIZE  rcvd: 1906</pre>
<p>If you did not receive a answer like this, you need to fix your firewall.</p>
<p>If all the above tests succeeded, then you should have no issues when all the root servers are responding with signed versions of the root zone.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.dest-unreach.be/2010/02/10/dnssec-firewall-issues/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DNSSEC &#8211; Implementation</title>
		<link>http://blog.dest-unreach.be/2010/01/24/dnssec-implementation</link>
		<comments>http://blog.dest-unreach.be/2010/01/24/dnssec-implementation#comments</comments>
		<pubDate>Sun, 24 Jan 2010 12:13:41 +0000</pubDate>
		<dc:creator>Niobos</dc:creator>
				<category><![CDATA[Networking & Security]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[dnssec]]></category>

		<guid isPermaLink="false">http://blog.dest-unreach.be/?p=1116</guid>
		<description><![CDATA[DNSSEC, short for DNS security, provides a security extension to the all important DNS system. A nice intro can be found on wikipedia. This is a part of a series on DNSSEC: The RRSIG record The NSEC and NSEC3 record The DNSKEY and DS record Implementation Time to put things together and setup a simple [...]]]></description>
			<content:encoded><![CDATA[<p>DNSSEC, short for DNS security, provides a security extension to the all important DNS system. A nice intro can be found on <a href="http://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions">wikipedia</a>. This is a part of a series on DNSSEC:</p>
<ol>
<li><a href="/2010/01/17/dnssec-the-rrsig-record">The RRSIG record</a></li>
<li><a href="/2010/01/20/dnssec-the-nsec-and-nsec3-record">The NSEC and NSEC3 record</a></li>
<li><a href="/2010/01/22/dnssec-the-dnskey-and-ds-record">The DNSKEY and DS record</a></li>
<li>Implementation</li>
</ol>
<p>Time to put things together and setup a simple DNSSEC secured zone using BIND. Instead of providing a walkthrough, I&#8217;m just going to refer to the <a href="http://www.nlnetlabs.nl/publications/dnssec_howto/index.html">DNSSEC HOWTO</a> (<a href="http://blog.dest-unreach.be/wp-content/uploads/2010/01/dnssec_howto.pdf">local mirror of the PDF version</a>) of <a href="http://www.nlnetlabs.nl/">NLnetLabs</a>. It provides a very thorough explanation of the whole DNSSEC concept, including copy-paste examples to try out. Also, it goes more into practical details such as key rollover, the benefits of using two keys (a Zone Signing Key, or ZSK, and a Key Signing Key, KSK).</p>
<p><span id="more-1116"></span></p>
<p>I also want to note that it&#8217;s perfectly possible to combine DNSSEC with <a href="http://blog.dest-unreach.be/2009/04/27/secure-dynamic-dns-updates">dynamic updates</a>. The only drawback is that the keys (at least the ZSK) must be available to the running BIND process. Depending on your security model, this might be an issue. Personally I&#8217;d argue that the BIND process has the ability to screw up your DNS-zone anyway. To enable this dynamic updates with DNSSEC, just merge this configuration in, as suggested by <a href="http://garnser.blogspot.com/2008/02/how-to-enable-bind-with-dnssec-and.html">Garnser</a>:</p>
<blockquote>
<pre>options {
 key-directory "/etc/keys";
};</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.dest-unreach.be/2010/01/24/dnssec-implementation/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DNSSEC &#8211; The DNSKEY and DS record</title>
		<link>http://blog.dest-unreach.be/2010/01/22/dnssec-the-dnskey-and-ds-record</link>
		<comments>http://blog.dest-unreach.be/2010/01/22/dnssec-the-dnskey-and-ds-record#comments</comments>
		<pubDate>Fri, 22 Jan 2010 15:13:39 +0000</pubDate>
		<dc:creator>Niobos</dc:creator>
				<category><![CDATA[Networking & Security]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[dnssec]]></category>

		<guid isPermaLink="false">http://blog.dest-unreach.be/?p=1595</guid>
		<description><![CDATA[DNSSEC, short for DNS security, provides a security extension to the all important DNS system. A nice intro can be found on wikipedia. This is a part of a series on DNSSEC: The RRSIG record The NSEC and NSEC3 record The DNSKEY and DS record Implementation To verify the digital signatures inside the RRSIG records, [...]]]></description>
			<content:encoded><![CDATA[<p>DNSSEC, short for DNS security, provides a security extension to the all important DNS system. A nice intro can be found on <a href="http://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions">wikipedia</a>. This is a part of a series on DNSSEC:</p>
<ol>
<li><a href="/2010/01/17/dnssec-the-rrsig-record">The RRSIG record</a></li>
<li><a href="/2010/01/20/dnssec-the-nsec-and-nsec3-record">The NSEC and NSEC3 record</a></li>
<li>The DNSKEY and DS record</li>
<li><a href="/2010/01/24/dnssec-implementation">Implementation</a></li>
</ol>
<p>To verify the <a href="http://en.wikipedia.org/wiki/Digital_signature">digital signatures</a> inside the RRSIG records, the client needs to have access to the corresponding public key. What better mechanism than DNS itself could be used to convey this information to the clients? Public keys are stored in DNSKEY records inside the zone. To facilitate key rollovers, new keys are added ahead of time, while old keys remain in the zone until all entries have expired in the caches.<span id="more-1595"></span>Obviously, the DNSKEY record is protected by an RRSIG, but this isn&#8217;t enough: The correctness of the DNSKEY record can be verified by the RRSIG, which can be verified by the DNSKEY! An additional mechanism to verify the DNSKEY is thus required. This is where the DS record comes in. It stores a summary of the DNSKEY in the <em>parent</em> zone, protected by the <em>parents</em> DNSKEY. This goes on in a tree-like structure, up to the root DNS zone. This root DNSKEY needs to be protected by some other means.</p>
<p>The following table shows the chain of protection. Every record is protected by the next row. The last row needs to be protected out-of-band. Note that the RRSIG and DNSKEY are in the same zone, while the DS is one level up.</p>
<table border="1">
<thead>
<tr>
<th>Owner name</th>
<th>Record type</th>
<th>Zone</th>
</tr>
</thead>
<tbody>
<tr>
<td>www.example.net.</td>
<td>A</td>
<td>example.net.</td>
</tr>
<tr>
<td>www.example.net.</td>
<td>RRSIG</td>
<td>example.net.</td>
</tr>
<tr>
<td>example.net.</td>
<td>DNSKEY</td>
<td>example.net.</td>
</tr>
<tr>
<td>example.net.</td>
<td>DS</td>
<td>net.</td>
</tr>
<tr>
<td>example.net.</td>
<td>RRSIG</td>
<td>net.</td>
</tr>
<tr>
<td>net.</td>
<td>DNSKEY</td>
<td>net.</td>
</tr>
<tr>
<td>net.</td>
<td>DS</td>
<td>.</td>
</tr>
<tr>
<td>net.</td>
<td>RRSIG</td>
<td>.</td>
</tr>
<tr>
<td>.</td>
<td>DNSKEY</td>
<td>.</td>
</tr>
</tbody>
</table>
<h3>DLV</h3>
<p>As said before, this whole chain depends on the root zone being signed. At this moment, this is not the case (current plans are july 2010). So instead of a single &#8220;Secure Entry Point&#8221; (the root), there are many: one for every orphan zone (in DNSSEC-sense). To provide a temporary workaround, <a href="https://www.isc.org/solutions/dlv">DLV</a> (DNSSEC Look-aside Validation) has been invented. This is a database containing the DS records of a lot of DNSSEC-zones, thereby providing a single Secure Entry Point (SEP) for the majority of the DNSSEC world.</p>
<h3>The record data for DNSKEY</h3>
<blockquote>
<pre>ripe.net.        3379 IN    DNSKEY 257 3 5 (
                            AwEAAa/KVVdwmvrpdIP650gGoFqbx/W76h+APAJyxfpx
                            YIuT3AJqXy+6reUNzaTC89O6UBmFMPKFoLP9iavAcfgc
                            QnmI50XoCWRCnCF30CIIaIOMJ5ze4s8QIT0MPHDHM5l5
                            vBo87Bu6CUNn3FrmiC0LJd9fqvwvI3P4Z4GQ+xb06w3a
                            h3NOxUaqhizoDcqsFERY8QGYmiFb33cOIseYJNkufomf
                            PLkVeTC2R6CU6zNdFXbeNOqv7pTW1/jftlsH5L6mJEdk
                            71VHg4+Y2q/VuR7+s/Ju/VpVELS5ggcyjK2O0Ei5kPKg
                            m9zpOjSw4wJWhbp7PVTxX3PnvyxuRlOJs2ksdcE=
                            ) ; key id = 12319</pre>
</blockquote>
<p>This is a summary of <a href="http://tools.ietf.org/html/rfc4034#section-2">RFC 4034, chapter 2</a>.</p>
<ol>
<li>The flags: bit 7 (256) indicated this is a ZONE-key (the kind of keys used for DNSSEC). Bit 15 (1) indicates this is a Secure Entry Point</li>
<li>Protocol: The only currently defined value is 3.</li>
<li>Algorithm: The type of key. In this case RSA/SHA-1</li>
<li>The key itself</li>
</ol>
<h3>The record data for DS</h3>
<blockquote>
<pre>gov.br.            86400 IN DS 8401 5 1 (
                            5248DB0EAE4E829924F19D33B005FBC8C4606058 )</pre>
</blockquote>
<p>This is a summary of <a href="http://tools.ietf.org/html/rfc4034#section-5">RFC 4034, chapter 5</a>.</p>
<ol>
<li>The key tag</li>
<li>Algorithm: The type of key. RSA/SHA-1 in this case</li>
<li>Digest type: the method used to calculate the digest. In this case SHA-1</li>
<li>The digest itself</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.dest-unreach.be/2010/01/22/dnssec-the-dnskey-and-ds-record/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DNSSEC &#8211; the NSEC and NSEC3 record</title>
		<link>http://blog.dest-unreach.be/2010/01/20/dnssec-the-nsec-and-nsec3-record</link>
		<comments>http://blog.dest-unreach.be/2010/01/20/dnssec-the-nsec-and-nsec3-record#comments</comments>
		<pubDate>Wed, 20 Jan 2010 15:11:40 +0000</pubDate>
		<dc:creator>Niobos</dc:creator>
				<category><![CDATA[Networking & Security]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[dnssec]]></category>

		<guid isPermaLink="false">http://blog.dest-unreach.be/?p=1582</guid>
		<description><![CDATA[DNSSEC, short for DNS security, provides a security extension to the all important DNS system. A nice intro can be found on wikipedia. This is a part of a series on DNSSEC: The RRSIG record The NSEC and NSEC3 record The DNSKEY and DS record Implementation While the RRSIG record allows you to verify the [...]]]></description>
			<content:encoded><![CDATA[<p>DNSSEC, short for DNS security, provides a security extension to the all important DNS system. A nice intro can be found on <a href="http://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions">wikipedia</a>. This is a part of a series on DNSSEC:</p>
<ol>
<li><a href="/2010/01/17/dnssec-the-rrsig-record">The RRSIG record</a></li>
<li>The NSEC and NSEC3 record</li>
<li><a href="/2010/01/22/dnssec-the-dnskey-and-ds-record">The DNSKEY and DS record</a></li>
<li><a href="/2010/01/24/dnssec-implementation">Implementation</a></li>
</ol>
<p>While the RRSIG record allows you to verify the authenticity of returned records, there is still a gap remaining. What if the requested name <em>does not</em> exist? Since the DNS server replies with an empty answer section, there is nothing to sign. That&#8217;s where NSEC (or its brother NSEC3) comes into play. An NSEC record (Next SECure) states the range of names that do <em>not</em> exist. By signing this NSEC record by a corresponding RRSIG record, one can prove that a domainname does in fact not exist.</p>
<h3><span id="more-1582"></span></h3>
<p>For every existing name, there is a corresponding NSEC record. This NSEC record states what types are available for the current name, as well as the next valid name is in the sorted zone file. This brings us to the downside of NSEC: Since the NSEC records essentially chain through the complete zone, it&#8217;s possible to do &#8220;zone walking&#8221;. While every single entry isn&#8217;t a secret, handing out the complete zone is different. To quote Paul Albitz and Cricket Liu from their <a rel="nofollow" href="http://oreilly.com/catalog/9780596001582/">DNS and BIND</a>:</p>
<blockquote><p>It&#8217;s the difference between letting random folks call your company&#8217;s switchboard and ask for John Q. Cubicle&#8217;s phone number [versus] sending them a copy of your corporate phone directory.</p></blockquote>
<p>This is where NSEC3 comes into play. The principle is exactly the same as for NSEC, but in the hashed domain. Normal NSEC looks like this:<br />
<img class="alignnone size-full wp-image-1584" title="NSEC-diagram.001" src="/wp-content/uploads/2010/01/NSEC-diagram.001.png" alt="" width="317" height="130" /><br />
NSEC3 looks like this. I choose an artificial hash function, normal hash values are much longer.<br />
<img class="alignnone size-full wp-image-1585" title="NSEC3-diagram.001" src="/wp-content/uploads/2010/01/NSEC3-diagram.001.png" alt="" width="415" height="145" /></p>
<p>Because the client knows how the hashes are calculated, it can still verify the assertion.</p>
<h3>The proof of non-existance</h3>
<p>Let&#8217;s assume a request is made for &#8220;charlie&#8221; for the above zone. The server answers with an NXDOMAIN status, and additionally provides an NSEC record:</p>
<pre>beta.example.net. NSEC delta.example.net. A RRSIG NSEC</pre>
<p>This asserts that there is no valid name between &#8220;beta&#8221; and &#8220;delta&#8221;. In addition it states that the only data available for &#8220;beta&#8221; is an A, RRSIG and NSEC record. Since &#8220;charlie&#8221; sorts between &#8220;beta&#8221; and &#8220;delta&#8221;, this is a proof that &#8220;charlie&#8221; does not exist.</p>
<p>The NSEC3 case is similar. First the server calculates the hash for &#8220;charlie&#8221;, in this example &#8220;a10c&#8221;. It then provides the following record:</p>
<pre>810c.example.net. NSEC 1 0 5 5A17 c73a A RRSIG</pre>
<p>This asserts that there is no valid hash between &#8220;810c&#8221; and &#8220;c73a&#8221;. It also states the algorithm used to calculate the hash (1) as well as the used salt (5A17) and iterations (5). This allows the client to calculate for itself the hash for &#8220;charlie&#8221; and verifying that it sorts between the two given hashes in the NSEC3 record.</p>
<p>However, this is not enough: DNS supports a wildcard function! So in addition to proving that the required name does not exist, the servers inserts an additional NSEC(3) record, proving that there is no wildcard that matches the request.</p>
<h3>The record data for NSEC</h3>
<blockquote>
<pre>dodo.ripe.net.        7147 IN    NSEC dog.ripe.net. A RRSIG NSEC</pre>
</blockquote>
<p>This is a summary of <a href="http://tools.ietf.org/html/rfc4034#section-4">RFC 4034, chapter 4</a>.</p>
<ol>
<li>The next owner name: All names between the owner name and this next domain name don&#8217;t exist.</li>
<li>The type bitmap: List all types of data for the owner name. Other types don&#8217;t exist.</li>
</ol>
<h3>The record data for NSEC3</h3>
<blockquote>
<pre>4mm2csfll0cb2su9pdbfkfapnc15f1tq.org. 900 IN NSEC3 1 1 1 D399EAAB
                                             4MS4SFN10P02UCOG4M1AMDC41CAO1ITQ A RRSI</pre>
</blockquote>
<p>This is a summary of <a href="http://tools.ietf.org/html/rfc5155#section-3">RFC 5155, chapter 3</a>.</p>
<ol>
<li>The hash algorithm used for the hash calculation (in this case SHA1)</li>
<li>Flags: The only defined flag at this moment is the <a href="http://communitydns.eu/DNSSEC.pdf">Opt-Out flag</a>.</li>
<li>Iterations: The hash-function can be iterated over. This increases calculation time and thus its cryptographic strength.</li>
<li>Salt: An additional value used in the hash calculation. This increases the cryptographic strength.</li>
<li>Next hashed owner name: The next item in the chain. All domain names with hashes between the owner name and this value don&#8217;t exist.</li>
<li>The type bitmap: List all types of data for the (hashed) owner name. Other types don&#8217;t exist.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.dest-unreach.be/2010/01/20/dnssec-the-nsec-and-nsec3-record/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DNSSEC &#8211; The RRSIG record</title>
		<link>http://blog.dest-unreach.be/2010/01/17/dnssec-the-rrsig-record</link>
		<comments>http://blog.dest-unreach.be/2010/01/17/dnssec-the-rrsig-record#comments</comments>
		<pubDate>Sun, 17 Jan 2010 09:34:38 +0000</pubDate>
		<dc:creator>Niobos</dc:creator>
				<category><![CDATA[Networking & Security]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[dnssec]]></category>

		<guid isPermaLink="false">http://blog.dest-unreach.be/?p=1572</guid>
		<description><![CDATA[DNSSEC, short for DNS security, provides a security extension to the all important DNS system. A nice intro can be found on wikipedia. This is a part of a series on DNSSEC: The RRSIG record The NSEC and NSEC3 record The DNSKEY and DS record Implementation The RRSIG record is the basic building block of [...]]]></description>
			<content:encoded><![CDATA[<p>DNSSEC, short for DNS security, provides a security extension to the all important DNS system. A nice intro can be found on <a href="http://en.wikipedia.org/wiki/Domain_Name_System_Security_Extensions">wikipedia</a>. This is a part of a series on DNSSEC:</p>
<ol>
<li>The RRSIG record</li>
<li><a href="/2010/01/20/dnssec-the-nsec-and-nsec3-record">The NSEC and NSEC3 record</a></li>
<li><a href="/2010/01/22/dnssec-the-dnskey-and-ds-record">The DNSKEY and DS record</a></li>
<li><a href="/2010/01/24/dnssec-implementation">Implementation</a></li>
</ol>
<p>The RRSIG record is the basic building block of DNSSEC. It accompanies every Resource Record Set (RRset) and provides a <a href="http://en.wikipedia.org/wiki/Digital_signature">digital signature</a> over the provided data. This record is only supplied if the client indicates that it understands DNSSEC. A client does so by setting the DO (DNSSEC OK) flag (part of <a href="http://en.wikipedia.org/wiki/EDNS">EDNS</a>). If the server adds this record, it can be used to prove that the received data is authentic and hasn&#8217;t been tampered with (or prove the opposite). If, on the other hand, the response doesn&#8217;t contain RRSIG records, there are two possibilities. Probably the zone just doesn&#8217;t use DNSSEC, but it&#8217;s also possible that the response has been tampered with and had its RRSIG removed. Unless you have some prior knowledge, it&#8217;s impossible to know which case you&#8217;re in. This should be solved once the root-zone becomes signed in July 2010.</p>
<p><span id="more-1572"></span></p>
<h3>The record data</h3>
<blockquote>
<pre>ripe.net.        165001 IN A 193.0.6.139
ripe.net.        165001 IN RRSIG    A 5 2 172800 20100203123710 (
                         20100104123710 53562 ripe.net.
                         f9f11o1gl54uVZKlEGYm7hX9HZR5Hh4gYaWi9EuImPx7
                         pBD0OGluG48vMmXDIoPmu0iWi6Y9yhqKm3SsPKHUuOHB
                         +YFD+5ACXh6X8eqNzYo3vw/mik2bRNFB1nyE4gATAgaw
                         hJZy8o2BB/QgX7QE3V0hxN1Qvdy6roldSEcAJq7HsJmz
                         aR2T7F6GLaon6qOH9tLpNWAD )</pre>
</blockquote>
<p>This is a summary of <a href="http://tools.ietf.org/html/rfc4034#section-3">RFC 4034, chapter 3</a>.</p>
<ol>
<li>The type covered field: Which type of data is covered by this signature. In this case, the preceding A-record.</li>
<li>The algorithm field: Indicates the algorithm used to calculate the signature. In this case 5 (RSA/SHA1).</li>
<li>The labels field: Indicates how many labels the original ownername has. In this case 2 (i.e. ripe.net). This field serves to indicate if the RRSIG is synthesized from a wildcard record.</li>
<li>The original TTL field: The TTL of the record on the authoritative name server. In this case 172800 seconds.</li>
<li>Signature expiration and inception: Indicated from when till when this signature is valid. In this case from the 4th of January 2010 till roughly a month later.</li>
<li>The key tag field: The key-id of the key used to produce this signature.</li>
<li>The signer&#8217;s name field: The ownername of the DNSKEY record that contains the key used to produce this signature.</li>
<li>The signature field: The signature itself. It secures: the records identified by its name and &#8220;type covered&#8221; field, as well as all previous fields of the RRSIG record itself.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.dest-unreach.be/2010/01/17/dnssec-the-rrsig-record/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Secure dynamic DNS updates</title>
		<link>http://blog.dest-unreach.be/2009/04/27/secure-dynamic-dns-updates</link>
		<comments>http://blog.dest-unreach.be/2009/04/27/secure-dynamic-dns-updates#comments</comments>
		<pubDate>Mon, 27 Apr 2009 15:54:52 +0000</pubDate>
		<dc:creator>Niobos</dc:creator>
				<category><![CDATA[Networking & Security]]></category>
		<category><![CDATA[DNS]]></category>

		<guid isPermaLink="false">http://blog.dest-unreach.be/?p=1106</guid>
		<description><![CDATA[When hosts have a dynamic IP, it&#8217;s very convenient to have its DNS-name follow that dynamic IP. There are several services on the net that do this. However, the regular DNS already provides this feature. The nsupdate tool (comes with BIND) allows you to send an update to the DNS servers. By default, a DNS [...]]]></description>
			<content:encoded><![CDATA[<p>When hosts have a dynamic IP, it&#8217;s very convenient to have its DNS-name follow that dynamic IP. There are <a href="http://www.dyns.cx/">several</a> <a href="http://www.dyndns.com/">services</a> on the net that do this. However, the regular DNS already provides <a href="ftp://ftp.rfc-editor.org/in-notes/rfc2136.txt">this feature</a>. The nsupdate tool (comes with <a href="https://www.isc.org/software/bind/">BIND</a>) allows you to send an update to the DNS servers. By default, a DNS server does not allow updates for security reasons.</p>
<p>To keep the whole world from updating your zone, there are several possibilities to restrict who can update what. The easiest to setup is an IP restriction: specify from which IPs updates are to be accepted. In my setup, however, I&#8217;d like the host to update its own record. Since the host&#8217;s IP is dynamic, this is not an option.</p>
<p><span id="more-1106"></span>The other way to limit updates is by using cryptography: only people knowing the secret can send updates. This comes in two variants: <a href="http://www.bind9.net/manual/bind/9.3.2/Bv9ARM.ch04.html#tsig">TSIG</a> and <a href="http://www.bind9.net/manual/bind/9.3.2/Bv9ARM.ch04.html#id2550173">SIG(0)</a>. <a href="http://www.ops.ietf.org/dns/dynupd/secure-ddns-howto.html">This site</a> goes more into the details, but here are the basics.</p>
<blockquote>
<pre>$ dnssec-keygen -a RSASHA1 -b 768 -k -n HOST keyid.example.net.</pre>
</blockquote>
<p>Note that the <em>keyid</em> should be inside your zone! This generates two files, a <em>.key</em> and a <em>.private</em> file. The key should be added to the zone; the private file should be kept secret (obviously).</p>
<p>Next, configure what the key can do inside the named.conf:</p>
<blockquote>
<pre>zone "example.net" {
    type master;
    file "pri/example.net";
    update-policy {
        grant keyid.example.net. name specific.example.net. A;
        grant otherkeyid.example.net. subdomain example.net. ANY;
        grant * self * A TXT;  // allow any key to update its own A and TXT records
    };
};</pre>
</blockquote>
<p>You can test the update with:</p>
<blockquote>
<pre>$ nsupdate -k /path/to/private/key/Kkeyid.example.net.+005+29297.key
&gt; server ns.example.net
&gt; update add test.example.net. 300 A 127.0.0.1
&gt; send
&gt; quit
$ dig @ns.example.net -t A test.example.net</pre>
</blockquote>
<p>Don&#8217;t try to check the raw zone-file. The new record will not be in there (yet). If you really want the zone-file to be updated (e.g. if you want to edit it), you need to (temporarily) disable dynamic updates:</p>
<blockquote>
<pre># rndc freeze example.net           # disable updates
# vim /etc/bind/pri/example.net     # remember to update the serial
# rndc reload example.net
# rndc thaw example.net             # enable updates</pre>
</blockquote>
<p>Since Bind now receives updates through DNS, be sure to check the permissions on your zone-files: bind should be allowed to write to them!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dest-unreach.be/2009/04/27/secure-dynamic-dns-updates/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

