<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.1.3" -->
<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/"
	>

<channel>
	<title>techblog</title>
	<link>http://blog.nominet.org.uk/tech</link>
	<description>random technical thoughts from the Nominet technical team</description>
	<pubDate>Tue, 30 Jun 2009 13:14:17 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1.3</generator>
	<language>en</language>
			<item>
		<title>WHOIS lookups and domain name registrations follow news events</title>
		<link>http://blog.nominet.org.uk/tech/2009/06/30/whois-lookups-and-domain-name-registrations-follow-news-events/</link>
		<comments>http://blog.nominet.org.uk/tech/2009/06/30/whois-lookups-and-domain-name-registrations-follow-news-events/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 13:11:16 +0000</pubDate>
		<dc:creator>alessandro</dc:creator>
		
		<category><![CDATA[DNS]]></category>

		<category><![CDATA[whois]]></category>

		<category><![CDATA[data analysis]]></category>

		<guid isPermaLink="false">http://blog.nominet.org.uk/tech/2009/06/30/whois-lookups-and-domain-name-registrations-follow-news-events/</guid>
		<description><![CDATA[The day following the death of Michael Jackson, Google published a graph showing that their system were heavily hit by queries related to this news. Details can be found on the Google Official Blog.
Our experiments suggest that Nominet systems experienced an analogous, although orders of magnitude smaller, phenomenon. The following figures show the number of [...]]]></description>
			<content:encoded><![CDATA[<p>The day following the death of Michael Jackson, Google published a graph showing that their system were heavily hit by queries related to this news. Details can be found on the <a href="http://googleblog.blogspot.com/2009/06/outpouring-of-searches-for-late-michael.html" rel="nofollow" linktype="raw" wikidestination="http://googleblog.blogspot.com/2009/06/outpouring-of-searches-for-late-michael.html" aliasspecified="true">Google Official Blog</a>.</p>
<p>Our experiments suggest that Nominet systems experienced an analogous, although orders of magnitude smaller, phenomenon. The following figures show the number of new registrations per hour of domain names that contain the name of Michael Jackson (or part of it) and the number of WHOIS queries that Nominet systems received in the same period.</p>
<p><a href="http://blog.nominet.org.uk/tech/wp-content/uploads/2009/06/michaeljackson-no-labels.jpg" title="Michael Jackson Graphs"><img src="http://blog.nominet.org.uk/tech/wp-content/uploads/2009/06/michaeljackson-no-labels.jpg" title="Michael Jackson Graphs" alt="Michael Jackson Graphs" align="middle" border="1" width="693" height="231" /></a></p>
<p>The two graphs are highly correlated because it is common practice for domain name owners to make WHOIS lookups around the period of time they register new domains. The peak around the 27 of June in the second graph is probably related to news stories concerning suspicions about Michael&#8217;s death.  Apparently, it did not lead to an immediate rise in the number of domain name registrations.</p>
<p user="true" style="display: none">&nbsp;</p>
<p>We have conducted an informal analysis of the domain names that were registered in the last week. The majority of them belong to three categories: parking pages, commercial pages and commemorative sites such as blogs and forums. At the moment, we have no evidence of domain names <a href="http://www.computerworld.com/action/article.do?command=viewArticleBasic&amp;articleId=9134895" rel="nofollow" linktype="raw" wikidestination="http://www.computerworld.com/action/article.do?command=viewArticleBasic&amp;articleId=9134895" aliasspecified="true">used for scam or phishing</a>.</p>
<p user="true" style="display: none">&nbsp;</p>
<p>In general, this episode confirms (again) that the dynamics of the Domain Name System follow those of the &#8220;real world&#8221;. A question that is still partially unanswered is at which degree these dynamics are followed by Internet users, i.e. how much their navigation behaviour depends on news stories. In the following months we plan to study the correlation between DNS data and other public events. Google has done something similar in the past, by correlating <a href="http://www.google.org/flutrends/" rel="nofollow" linktype="raw" wikidestination="http://www.google.org/flutrends/" aliasspecified="true">Google searches for flu-related terms with the spread of flu in North America</a>. The results are very interesting and definitely merit extension to other data sources such as DNS traffic.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nominet.org.uk/tech/2009/06/30/whois-lookups-and-domain-name-registrations-follow-news-events/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Typo-Squatting: The &#8220;Curse&#8221; of Popularity</title>
		<link>http://blog.nominet.org.uk/tech/2009/06/24/typo-squatting-the-curse-of-popularity/</link>
		<comments>http://blog.nominet.org.uk/tech/2009/06/24/typo-squatting-the-curse-of-popularity/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 09:30:51 +0000</pubDate>
		<dc:creator>alessandro</dc:creator>
		
		<category><![CDATA[Anti-Spam]]></category>

		<category><![CDATA[Conferences]]></category>

		<category><![CDATA[papers]]></category>

		<category><![CDATA[typosquatting]]></category>

		<guid isPermaLink="false">http://blog.nominet.org.uk/tech/2009/06/24/typo-squatting-the-curse-of-popularity/</guid>
		<description><![CDATA[Typo-squatting is the practice of registering a domain name with the intent to confuse it with the name of a trademark or a famous other domain name
In March, I presented the paper Typo-Squatting: The &#8220;Curse&#8221; of Popularity in the poster session of the first International Conference on Web Science in Athens. The paper, written together [...]]]></description>
			<content:encoded><![CDATA[<p>Typo-squatting is the practice of registering a domain name with the intent to confuse it with the name of a trademark or a famous other domain name</p>
<p>In March, I presented the paper <em>Typo-Squatting: The &#8220;Curse&#8221; of Popularity</em> in the poster session of the first International Conference on Web Science in Athens. The paper, written together with co-authors <a href="http://cms.brookes.ac.uk/staff/DavidDuce/">David Duce</a> and <a href="http://cms.brookes.ac.uk/staff/FayeMitchell/">Faye Mitchell</a> (Oxford Brookes University) and Stephen Morris (Nominet) can be downloaded <a href="http://blog.nominet.org.uk/tech/wp-content/uploads/2009/06/full-paper-websci09.pdf" title="WebSci09 - Full Paper">here</a>.</p>
<p>In the paper we study typo-squatting from a statistical point of view. The distribution of names in the <em>co.uk</em> registry is analysed using the concepts of syntactic and visual neighbourhoods of a domain name (the sets of all other domain names which are syntactically or visually similar to to it).  Our preliminary results show a strong correlation between the popularity of a domain name and the size of its syntactical and visual neighbourhoods although, counter-intuitively, the neighbourhood size does not depend on length.  This suggests anomalous activity &#8220;around&#8221; very popular domain names, as well as indicating that the size of the neighbourhood can be used as a reliable indicator for the likelihood of being typo-squatted.<br />
<a href="http://blog.nominet.org.uk/tech/wp-content/uploads/2009/06/full-paper-websci09.pdf" title="WebSci09 - Full Paper"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nominet.org.uk/tech/2009/06/24/typo-squatting-the-curse-of-popularity/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ENUM for Google Android</title>
		<link>http://blog.nominet.org.uk/tech/2009/06/23/enum-for-google-android/</link>
		<comments>http://blog.nominet.org.uk/tech/2009/06/23/enum-for-google-android/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 11:28:36 +0000</pubDate>
		<dc:creator>ray</dc:creator>
		
		<category><![CDATA[DNS]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[Applications]]></category>

		<category><![CDATA[VoIP and ENUM]]></category>

		<guid isPermaLink="false">http://blog.nominet.org.uk/tech/2009/06/23/enum-for-google-android/</guid>
		<description><![CDATA[I&#8217;m pleased to announce the release of enumdroid.
This application adds ENUM (E.164 Number Mapping) support to your Android phone.
Each time you dial a full international number (i.e. starting with a &#8216;+&#8217;) your phone will check the DNS for additional routing information and offer you a list of alternate contact methods.
The application is open source (under [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m pleased to announce the release of <a href="http://code.google.com/p/enumdroid/">enumdroid</a>.</p>
<p>This application adds ENUM (E.164 Number Mapping) support to your Android phone.</p>
<p>Each time you dial a full international number (i.e. starting with a &#8216;+&#8217;) your phone will check the DNS for additional routing information and offer you a list of alternate contact methods.</p>
<p>The application is open source (under the Apache License) and the code is available for download from <a href="http://code.google.com/p/enumdroid/source/browse/#svn/trunk" target="_blank">Google Code</a>.  The application can be downloaded from the Google Market under Applications -&gt; Communication</p>
<p>Here are some screenshots, which show in turn:</p>
<ol>
<li>Nominet&#8217;s switchboard number being dialled</li>
<li>ENUM results being returned</li>
<li>A call being placed over the PSTN to a tel: URI</li>
<li>The ENUM application&#8217;s settings page</li>
</ol>
<table cellspacing="8">
<tr>
<td><img src="http://enumdroid.googlecode.com/svn/trunk/images/enumdroid-01.png" title="Dialing" alt="Dialing" height="240" width="160" /></td>
<td><img src="http://enumdroid.googlecode.com/svn/trunk/images/enumdroid-02.png" title="ENUM results" alt="ENUM results" height="240" width="160" /></td>
<td><img src="http://enumdroid.googlecode.com/svn/trunk/images/enumdroid-03.png" title="Calling" alt="Calling" height="240" width="160" /></td>
<td><img src="http://enumdroid.googlecode.com/svn/trunk/images/enumdroid-04.png" title="Settings" alt="Settings" height="240" width="160" /></td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blog.nominet.org.uk/tech/2009/06/23/enum-for-google-android/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Notes from UXLondon</title>
		<link>http://blog.nominet.org.uk/tech/2009/06/22/notes-from-uxlondon/</link>
		<comments>http://blog.nominet.org.uk/tech/2009/06/22/notes-from-uxlondon/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 12:58:06 +0000</pubDate>
		<dc:creator>Al</dc:creator>
		
		<category><![CDATA[Conferences]]></category>

		<guid isPermaLink="false">http://blog.nominet.org.uk/tech/2009/06/22/notes-from-uxlondon/</guid>
		<description><![CDATA[Last week I attended the user experience conference UXLondon organised by Clearleft, with a solid day of keynote talks, followed by two days of half-day workshops.
In brief summary the conference highlighted several key points:

How we should work with the customer at all stages to ensure both designer and customer are working towards the same goals.
Developing [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I attended the user experience conference <a href="http://uxlondon.com/">UXLondon</a> organised by <a href="http://clearleft.com/">Clearleft</a>, with a solid day of keynote talks, followed by two days of half-day workshops.</p>
<p>In brief summary the conference highlighted several key points:</p>
<ul>
<li>How we should work with the customer at all stages to ensure both designer and customer are working towards the same goals.</li>
<li>Developing software that is intuitive, aligned with user behaviour, can really make a software product stand out from it&#8217;s competitors.</li>
<li>How using prototypes before starting development can really help iron out usability bugs before investing too much time and expense.</li>
<li>Designing good interfaces for complex systems is hard!</li>
</ul>
<p>My own detailed notes can be found in &#8220;<a href="http://alpower.com/2009/06/22/uxlondon-notes-on-user-experience-and-design/">UXLondon – Notes on User Experience and Design</a>&#8221; (with one of the presentations embedded), where I talk more about what I personally learnt and what I thought of the individual sessions attended.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nominet.org.uk/tech/2009/06/22/notes-from-uxlondon/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Watch out for Time offsets in Ruby!</title>
		<link>http://blog.nominet.org.uk/tech/2009/06/11/watch-out-for-time-offsets-in-ruby/</link>
		<comments>http://blog.nominet.org.uk/tech/2009/06/11/watch-out-for-time-offsets-in-ruby/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 06:31:29 +0000</pubDate>
		<dc:creator>alexd</dc:creator>
		
		<category><![CDATA[DNS]]></category>

		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.nominet.org.uk/tech/2009/06/11/watch-out-for-time-offsets-in-ruby/</guid>
		<description><![CDATA[I got bitten by a silly bug in my dnsruby code recently - I thought I&#8217;d share it here in case anyone else starts pulling their hair out over this in future!
DNSSEC RRSIG records contain the signatures required to prove that a DNS zone has been correctly signed by an entity which possesses the correct [...]]]></description>
			<content:encoded><![CDATA[<p>I got bitten by a silly bug in my dnsruby code recently - I thought I&#8217;d share it here in case anyone else starts pulling their hair out over this in future!</p>
<p>DNSSEC RRSIG records contain the signatures required to prove that a DNS zone has been correctly signed by an entity which possesses the correct keys for the zone. DNS clients can obtain the correct keys for the zone, then use the RRSIG records to prove that the zone (or record of interest) is correct. Of course, these records shouldn&#8217;t last forever - the data records are periodically re-signed (possibly with different keys), and the RRSIGs updated. The RRSIG includes an inception time, and an expiration time, to show the period over which it is valid. To verify a set of records, the DNS client must first produce an array of bytes, the digest of which is taken and used as the signature for the records - the salient data of of the RRSIG record (including the inception and expiration times) is included in this set of bytes.</p>
<p>The code I had written to do this was working fine - I had coded in the examples from the RFCs, and done a lot of work with actual signed zones (reading the data from the authoritative servers, and proving that it was correct). However, when I started to try to do this with real-world zone files, I started noticing that the signatures weren&#8217;t verifying. At least, they *sometimes* weren&#8217;t verifying. Very odd. Of course, with this kind of work, all you get is a Pass/Fail - no clue as to what is going wrong. I could see that the records were being translated to and from text format correctly - all the data in the RRs was showing as fine. However, when I compared the byte sequences prepared by my DNS client and Net::DNS, I noticed that four bytes were different. It turned out that, of the four byte sequences written to for the RRSIG inception and expiration time, there was a difference of 0xE100 - this works out to 16 hours worth of 3600 seconds. At last, I was onto something!</p>
<p>There are several ways to express time in the presentation format of the RRSIG record - &#8220;1234567890&#8243; (seconds since 01/01/1970), or &#8220;YYYYMMDDHHMMSS&#8221; (e.g. &#8220;20090608123435&#8243;). Dnsruby worked fine with the first, and even translated the second from presentation format and back to presentation format correctly. However, when read using the following line :</p>
<p><code>return Time.mktime(year, mon, day, hour, min, sec).to_i</code></p>
<p>I got a 16 hour offset from the correct time! [When converting this time to/from the text format, the translation worked perfectly - it was only when inspecting the internal epoch time that the difference could be noticed]</p>
<p>I changed this to :</p>
<p><code>return Time.gm(year, mon, day, hour, min, sec).to_i</code></p>
<p>And suddenly everything worked just fine.</p>
<p>I&#8217;m sure that seasoned Rubyists will sneer at me for my stupidity - it did take me some time to track this one down! So, if you start noticing strange 16 hours offsets in your Ruby code, it&#8217;s worth checking your usage of the Time class&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nominet.org.uk/tech/2009/06/11/watch-out-for-time-offsets-in-ruby/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Examples of using Dnsruby with DNSSEC</title>
		<link>http://blog.nominet.org.uk/tech/2009/05/21/examples-of-using-dnsruby-with-dnssec/</link>
		<comments>http://blog.nominet.org.uk/tech/2009/05/21/examples-of-using-dnsruby-with-dnssec/#comments</comments>
		<pubDate>Thu, 21 May 2009 11:32:28 +0000</pubDate>
		<dc:creator>alexd</dc:creator>
		
		<category><![CDATA[DNS]]></category>

		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.nominet.org.uk/tech/2009/05/21/examples-of-using-dnsruby-with-dnssec/</guid>
		<description><![CDATA[In this post, I&#8217;d like to look at how to use Dnsruby with DNSSEC. As before, I&#8217;ll run these examples in irb, and assume that you&#8217;ve included Dnsruby there.
Dnsruby has DNSSEC support switched on by default. This means it will attempt to validate any DNS responses against its trust anchors. However, by default, no trust [...]]]></description>
			<content:encoded><![CDATA[<p>In this post, I&#8217;d like to look at how to use Dnsruby with DNSSEC. As <a href="http://blog.nominet.org.uk/tech/2009/05/19/some-examples-of-dnsruby-in-action/">before</a>, I&#8217;ll run these examples in irb, and assume that you&#8217;ve included Dnsruby there.</p>
<p>Dnsruby has DNSSEC support switched on by default. This means it will attempt to validate any DNS responses against its trust anchors. However, by default, no trust anchors are configured - to get dnsruby to validate responses, you must first configure a trust anchor (or DLV repository).</p>
<p><strong>Trust Anchors</strong></p>
<p>DNSSEC works by following a chain of trust from parent zone to child zone. This chain of trust must start somewhere - the &#8220;trust anchor&#8221;. In a world with a signed root, the root would be the anchor. Delegations to children zones would be signed, all the way down to the domain that is being queried. The querier can then be sure that the signed response is genuine. </p>
<p>Unfortunately, the root is not yet signed - we have many &#8220;islands of security&#8221;. Each island is signed, but has no chain to it from the root. It is possible to configure dnsruby with the keys for these zones using <code>Dnsruby::Dnssec#add_trust_anchor()</code> - it&#8217;s also possible to define an expiration time for each anchor. Dnsruby will then follow the chain of trust from the anchor down to the queried domain in the signed zone.</p>
<p>Managing these trust anchors quickly becomes a headache. You need to have secure means of obtaining and verifying them, and rolling over to new keys as time goes on. Fortunately, there are two mechanisms to help with this : IANA&#8217;s TAR and ISC&#8217;s DLV repository.</p>
<p>IANA (who manage the root zone) have created a Trust Anchor Repository (ITAR) which can be used until the root is signed. This holds delegation records for the DNSSEC-signed TLDs. It is possible to download this repository and configure dnsruby with the anchors. A method to do this is defined in <code>Dnsruby::Dnssec#load_itar</code>, but it is not currently secure. If you need to use the ITAR securely, you are currently advised to add the trust anchors from the ITAR directly into dnsruby. A secure method will be provided in future releases.</p>
<p><strong>DLV</strong></p>
<p>Even if the root was signed, there will still be some domains in unsigned zones, which wish to benefit from DNSSEC security. For example, <em>signed-zone.unsigned-zone.example.org</em> - there can be no chain of trust from the root to <em>signed-zone</em>. A solution exists for <em>signed-zone</em> : DNSSEC Lookaside Validation (<a href="http://www.rfc-editor.org/rfc/rfc4431.txt">DLV</a>). Here, a DLV repository holds secure delegation records for zones like <em>signed-zone</em>. Instead of following the chain of trust from the root, a validator follows the chain of trust from the closest parent zone known to the DLV repository. Of course, this method involves more validation queries for each application query. </p>
<p>As an example, considering querying for <em>random.example.com</em> - first, the query itself must be made. Then, if unsuccessful, a DLV query for <em>random.example.com.dlv.isc.org</em> must be made, followed by a query for <em>example.com.dlv.isc.org</em>, followed by a query for <em>com.dlv.isc.org</em>. If none of these succeed, then the message cannot be validated. Imagine that a response was received for the com.dlv.isc.org zone : then, the chain of trust could be followed through <em>example.com</em> down to <em>random.example.com</em>. Keys discovered from the DLV repository are cached.</p>
<p><strong>Configuring Trust Anchors</strong></p>
<p>To configure a trust anchor (in this case for the uk-dnssec.nic.uk DNSSEC test zone) : </p>
<pre>    trusted_key = Dnsruby::RR.create({:name => "uk-dnssec.nic.uk.",
        :type => Dnsruby::Types.DNSKEY,
        :flags => 257,
        :protocol => 3,
        :algorithm => 5,
        :key=> "AQPJO6LjrCHhzSF9PIVV7YoQ8iE31FXvghx+14E+jsv4uWJR9jLrxMYm sFOGAKWhiis832ISbPTYtF8sxbNVEotgf9eePruAFPIg6ZixG4yMO9XG LXmcKTQ/cVudqkU00V7M0cUzsYrhc4gPH/NKfQJBC5dbBkbIXJkksPLv Fe8lReKYqocYP6Bng1eBTtkA+N+6mSXzCwSApbNysFnm6yfQwtKlr75p m+pd0/Um+uBkR4nJQGYNt0mPuw4QVBu1TfF5mQYIFoDYASLiDQpvNRN3 US0U5DEG9mARulKSSw448urHvOBwT9Gx5qF2NE4H9ySjOdftjpj62kjb Lmc8/v+z"
      })
    Dnsruby::Dnssec.add_trust_anchor(trusted_key)</pre>
<p>Dnsruby will now attempt to validate any responses from the uk-dnssec.nic.uk zone (or its children).</p>
<p>To configure dnsruby to use ISC&#8217;s DLV repository, you must first obtain the key (from <a href="https://www.isc.org/solutions/dlv#dlv_key">here</a>). You can then configure dnsruby :</p>
<pre>    dlv_key = RR.create("DLV_KEY_STRING_FROM_ISC")
    Dnssec.add_dlv_key(dlv_key)</pre>
<p>This method queries the DLV registry to get the ZSK (zone signing key) from the above KSK (key signing key). Dnsruby will now attempt to validate all responses against the DLV repository, if it can&#8217;t validate from any trust anchors.</p>
<p><strong>Configuring Validation Policy</strong></p>
<p>It is possible to configure the validation policy to vary the precedence of search order - from the root only, or local anchors only,  or either first. Separate key caches are maintained by each validator, making it possible to configure them dynamically. DLV validation is only performed once the DLV key has been added. Here is an example of changing the validation policy :</p>
<pre>    Dnsruby::Dnssec.validation_policy = Dnsruby::Dnssec::ValidationPolicy::ROOT_THEN_LOCAL_ANCHORS</pre>
<p>It is possible to clear all trusted keys (which will also stop DLV validation) by calling :</p>
<pre>    Dnsruby::Dnssec.clear_trusted_keys()</pre>
<p>You can remove just the trust anchors (leaving DLV keys and validation from the root, and all keys generated from them), and the keys generated from them, by calling :</p>
<pre>    Dnsruby::Dnssec.clear_trust_anchors()</pre>
<p><strong>Configuring Validation Resolver</strong></p>
<p>When a response is validated, it may be necessary to make several more queries in order to follow the chain of trust. As more queries are made, more chains are followed. Trusted keys are cached as they are discovered (for the length of time they are indicated to be good for) - this means that future queries for domains in those zones will not require so many validation queries to be performed.</p>
<p>It&#8217;s possible to configure dnsruby to use different methods for performing the validation queries. They can either be directed to recursive nameservers (which can be the system defaults, or a client-supplied set of addresses), or they can be performed recursively. I have found that many resolvers do not yet speak a perfect dialect of DNSSEC - performing validation queries recursively ensures that the correct DNSSEC-signed responses are received. The default is to perform validation recursively. Of course, while the caches are being built up when dnsruby starts, more queries will be performed than if the queries were directed to recursive nameservers. </p>
<p>To ask dnsruby to use query a recursive nameserver, call :</p>
<pre>    Dnsruby::Dnssec.do_validation_with_recursor = false</pre>
<p>Dnsruby will now use the system default configured nameservers for validation.</p>
<p>To use a specific set of servers to perform validation :</p>
<pre>    res = Dnsruby::Resolver.new({:nameserver => ['192.168.1.1', '192.168.2.1']})
    Dnsruby::Dnssec.default_resolver = res</pre>
<p><strong>Validating Responses</strong></p>
<p>Once dnsruby has been configured with a trust anchor, it will attempt to validate any responses for domains within that zone (or its subzones). If it detects that validation is necessary, then it will fire up a new thread to handle that validation. Since many queries may need to be performed in order to validate the reponse, this can take some time longer than the original query would have done alone. This means that the query timing settings in the Resolver class apply only to each query - *not* to the whole validation process.</p>
<p>For example, a query may have a Resolver#query_timeout of 5 seconds. As long as the answer for that query is returned in 5 seconds, then no timeout will occur - even if it then takes another 6 seconds to validate that response. Future versions of dnsruby will include the ability for client applications to receive events detailing the progress of each asynchronous query (e.g. RECEIVED, VALIDATED).</p>
<p>It is possible to disable validation on a <code>Message</code> basis. Simply set :</p>
<pre>  msg.do_validation = false</pre>
<p>before sending the <code>Message</code> - dnsruby will not validate the response to that query.</p>
<p><strong>Message Security Levels</strong></p>
<p>Messages can have one of four security levels (defined in <code>Dnsruby::Message::SecurityLevel</code>) : <code>BOGUS</code>, <code>UNCHECKED</code>, <code>INSECURE</code> and <code>SECURE</code>. Dnsruby will only raise an error if it detects that a response is <code>BOGUS</code> - this means that the message does not contain the correct set of signatures. <code>INSECURE</code> means that the response has been verified to have come from a non-secured zone. <code>SECURE</code> means that the chain of trust has been correctly followed from a configured trust anchor to the response, and that all signatures check OK. Note that an NXDOMAIN response can still be <code>SECURE</code> - this means that the NSEC(3) records have been verified to prove non-existence.</p>
<p>To check the security level of a Message, use <code>Message#security_level</code> : </p>
<pre>  if (msg.security_level == Dnsruby::Message::SecurityLevel::SECURE)
      print "Response was validated OKn"
  end</pre>
<p><strong>Examples of Use</strong></p>
<p>DNSSEC examples can be found in the EXAMPLES file in the dnsruby distribution.</p>
<p><strong>Limitations</strong></p>
<p>Dnsruby does not yet perform NSEC3 validation (although NSEC3/NSEC3PARAM records can be read from the wire, or presentation format). This will be added to a future release.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nominet.org.uk/tech/2009/05/21/examples-of-using-dnsruby-with-dnssec/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Some examples of dnsruby in action</title>
		<link>http://blog.nominet.org.uk/tech/2009/05/19/some-examples-of-dnsruby-in-action/</link>
		<comments>http://blog.nominet.org.uk/tech/2009/05/19/some-examples-of-dnsruby-in-action/#comments</comments>
		<pubDate>Tue, 19 May 2009 14:44:31 +0000</pubDate>
		<dc:creator>alexd</dc:creator>
		
		<category><![CDATA[DNS]]></category>

		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.nominet.org.uk/tech/2009/05/19/some-examples-of-dnsruby-in-action/</guid>
		<description><![CDATA[In this post, I&#8217;d like to look at how to use dnsruby to accomplish some common tasks. 
Getting started
To follow these examples, you&#8217;ll need to install dnsruby :
$ gem install dnsruby
I&#8217;ll run these examples in Ruby&#8217;s interactive shell :
$ irb
First, I need to include Dnsruby :
>> require 'rubygems'
>> require 'dnsruby'
>> include Dnsruby
Now I&#8217;ll load the [...]]]></description>
			<content:encoded><![CDATA[<p>In this post, I&#8217;d like to look at how to use dnsruby to accomplish some common tasks. </p>
<p><strong>Getting started</strong></p>
<p>To follow these examples, you&#8217;ll need to install dnsruby :</p>
<p><code>$ gem install dnsruby</code></p>
<p>I&#8217;ll run these examples in Ruby&#8217;s interactive shell :</p>
<p><code>$ irb</code></p>
<p>First, I need to include Dnsruby :</p>
<pre>>> require 'rubygems'
>> require 'dnsruby'
>> include Dnsruby</pre>
<p>Now I&#8217;ll load the system&#8217;s default resolvers :</p>
<p><code>>> res = Resolver.new</code></p>
<p>And display them :</p>
<pre>>> res.single_resolvers.each {|s| print "Server address : #{s.server}n"}
Server address : 192.168.1.1
Server address : 192.168.2.2</pre>
<p>Now I&#8217;ll use them to run a couple of queries :</p>
<pre>>> ret = res.query("example.com") # Defaults to A record
>> print ret.answer
example.com.	172789	IN	A	208.77.188.166=> nil
>> res.query("example.com", "MX") # Query the MX record</pre>
<p>This time, I&#8217;ll use some defined nameservers :</p>
<pre>>> res = Resolver.new({:nameserver => ["ns1.nic.uk",
        "ns1.nic.uk"]})</pre>
<p><strong>Asynchronous Queries</strong></p>
<p>To run an asynchronous query, I&#8217;ll define a Queue to hold the results, and then prepare the query. This time, I&#8217;ll construct a <code>Message</code> to hold the query data, and set the RD (recursion desired) bit on the header to 0 :</p>
<pre>>> queue = Queue.new
>> m = Message.new("co.uk", Types.NS)
>> m.header.rd = false
>> message_id = res.send_async(m, queue, 1)</pre>
<p>Now my code can get on with other tasks, until I&#8217;m ready to get the response. <code>Queue#pop</code> is a blocking call, but you can check if it is empty using <code>Queue#empty?</code>.</p>
<p><code>>> id, reply, error = queue.pop # id == message_id</code></p>
<p>The <code>[id, reply, error]</code> tuple is popped off the <code>queue</code>. The <code>id</code> identifies which query the response is for (it should match the id returned by the <code>send_async</code> call), <code>reply</code> holds the best response that was received, and any errors will be held in <code>error</code> (which should be <code>nil</code> in this example).</p>
<p><strong>Message Options</strong></p>
<p>Now I&#8217;ll ask for a <code>Message</code> to be sent without checking (or the response being stored in) the cache. I&#8217;ll also make sure that no DNSSEC validation is performed on the response :</p>
<pre>>> m.do_caching = false
>> m.do_validation = false
>> res.send_message(m)</pre>
<p>I can ask for a <code>Message</code> to be sent without any pre- or post-processing. No EDNS headers are applied, the header flags are not adjusted, and no caching or validation is performed. This method is most useful for tools authors :</p>
<p><code>>> res.send_plain_message(Message.new("nic.uk"))</code></p>
<p><strong>TSIG and Dynamic Updates</strong></p>
<p>I can also use TSIG signatures to communicate securely with a resolver. In this example, I&#8217;ll use TSIG to sign a dynamic update. First, I&#8217;ll have to define the server to use, and the TSIG key to speak to it with :</p>
<pre>>> res = Dnsruby::Resolver.new("ns0.validation-test-servers.nominet.org.uk")
>> res.dnssec = false
>> tsig = Dnsruby::RR.create({
        :name        => "rubytsig",
        :type        => "TSIG",
         :key         => "8n6gugn4aJ7MazyNlMccGKH1WxD2B3UvN/O/RA6iBupO2/03u9CTa3Ewz3gBWTSBCH3crY4Kk+tigNdeJBAvrw==",
      })</pre>
<p>Now I&#8217;ll create the dynamic update packet :</p>
<pre>>> update = Dnsruby::Update.new("validation-test-servers.nominet.org.uk")
>> # ... add stuff to the update
>> update.absent("notthere.update.validation-test-servers.nominet.org.uk", 'TXT')</pre>
<p>And apply the TSIG signature and send the message :</p>
<pre>>> tsig.apply(update)
>> response = res.send_message(update)
>> print "TSIG response was verified? : #{response.verified?}n"</pre>
<p>I could also have configured the <code>Resolver</code> to sign *all* packets with TSIG :</p>
<p><code>>> res.tsig=tsig.name, tsig.key</code></p>
<p><strong>Recursive Queries</strong></p>
<p>In addition to defining nameservers to do recursive queries on my behalf, I can also get Dnsruby to query recursively from the root. A static cache is built up, so the more client queries that are run, the less packets need be sent per client query.</p>
<pre>>> rec = Recursor.new
>> ret = rec.query("uk-dnssec.nic.uk", "NS")</pre>
<p>In my next article, I&#8217;ll look at how use Dnsruby with DNSSEC.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nominet.org.uk/tech/2009/05/19/some-examples-of-dnsruby-in-action/feed/</wfw:commentRss>
		</item>
		<item>
		<title>DNSSEC Validation Support Added to Dnsruby 1.30</title>
		<link>http://blog.nominet.org.uk/tech/2009/05/19/dnssec-validation-support-added-to-dnsruby-130/</link>
		<comments>http://blog.nominet.org.uk/tech/2009/05/19/dnssec-validation-support-added-to-dnsruby-130/#comments</comments>
		<pubDate>Tue, 19 May 2009 11:24:04 +0000</pubDate>
		<dc:creator>alexd</dc:creator>
		
		<category><![CDATA[DNS]]></category>

		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.nominet.org.uk/tech/2009/05/19/dnssec-validation-support-added-to-dnsruby-130/</guid>
		<description><![CDATA[I&#8217;m very pleased to announce the release of dnsruby version 1.30 (RDoc available here). This version constitutes a considerable advance of functionality on previous dnsruby releases. Although it is still possible to use dnsruby in just the same way (which proves useful for tools authors), it is now also capable of full DNSSEC validation, using [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m very pleased to announce the release of <a href="http://rubyforge.org/projects/dnsruby/">dnsruby</a> version 1.30 (RDoc available <a href="http://dnsruby.rubyforge.org">here</a>). This version constitutes a considerable advance of functionality on previous dnsruby releases. Although it is still possible to use dnsruby in just the same way (which proves useful for tools authors), it is now also capable of full DNSSEC validation, using either ISC&#8217;s DLV registry, IANA&#8217;s Trust Anchor Repository, or any trust anchors it is configured with.</p>
<p>Clients can configure the validation policy (e.g. whether to try local trust anchors first, followed by ITAR, then DLV, or some other order), whether to use recursion or a local resolver in the validation process, and manage the store of trusted keys themselves. Dnsruby still offers the verify method to verify a Message or RRSet against a set of keys, but also includes the validate method (called automatically by default) which kicks off a separate validation thread (if validation is necessary). This thread follows the chain of trust from the closest trusted key, and records the result in the Dnsruby::Message#security_level. Exceptions are only raised if the SecurityLevel is BOGUS.</p>
<p>Dnsruby::Recursor now includes a static authority cache. This means that dnsruby can now be used to perform entirely recursive querying - especially useful if you don&#8217;t trust your local resolvers, or they don&#8217;t yet speak a correct dialect of DNSSEC.</p>
<p>Other improvements include dynamic management of configured nameservers - more responsive ones will be preferred over slower, and servers which don&#8217;t respond at all, or give broken responses, will be pushed to the back of the line. A cache has been added for received (and validated) Messages. It is possible to avoid use of this cache on a Message basis.</p>
<p>Support for EventMachine has been removed. I&#8217;ve had to rework dnsruby&#8217;s event system considerably in order to include validation support, and it was no longer feasible to maintain two IO loops. The native Ruby event loop in dnsruby has no known issues, and that is the recommended (and only) option. It should still be possible to work dnsruby into EventMachine projects.</p>
<p>I plan to write another article soon, with more detail on how to achieve common DNS(SEC) tasks with dnsruby. In the meantime, please let me know if you have any issues using the latest version!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nominet.org.uk/tech/2009/05/19/dnssec-validation-support-added-to-dnsruby-130/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Signing ENUM XML tokens</title>
		<link>http://blog.nominet.org.uk/tech/2009/03/27/signing-enum-xml-tokens/</link>
		<comments>http://blog.nominet.org.uk/tech/2009/03/27/signing-enum-xml-tokens/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 10:24:54 +0000</pubDate>
		<dc:creator>Anthony</dc:creator>
		
		<category><![CDATA[XML]]></category>

		<category><![CDATA[VoIP and ENUM]]></category>

		<guid isPermaLink="false">http://blog.nominet.org.uk/tech/2009/03/27/signing-enum-xml-tokens/</guid>
		<description><![CDATA[In order to register an ENUM, a XML token (RFC5105) is signed by a Validation Agency to say that the user has a given phone number &#38; so has the right to a ENUM registration; this token is sent by an ENUM Registrar to Nominet&#8217;s EPP server.
This process of signing a token isn&#8217;t entirely straightforward:
The [...]]]></description>
			<content:encoded><![CDATA[<p>In order to register an <a href="http://www.nominet.org.uk/enum">ENUM</a>, a XML token (RFC5105) is signed by a <a href="http://www.nominet.org.uk/enum/registrars/validation/">Validation Agency</a> to say that the user has a given phone number &amp; so has the right to a ENUM registration; this token is sent by an <a href="http://www.nominet.org.uk/enum/registrars/">ENUM Registrar</a> to <a href="http://www.nominet.org.uk/enum/enumregistrarsystems/epp/">Nominet&#8217;s EPP server</a>.</p>
<p>This process of signing a token isn&#8217;t entirely straightforward:</p>
<p>The simplest way to sign a token is to use the <em>templatesign</em> tool from the <a href="http://santuario.apache.org/c/index.html">Apache XML Security project</a>.</p>
<pre>$ templatesign -r testVA.key password -c -x testVA.cert unsigned_token.xml &gt; signed_token.xml</pre>
<p>A token signed by <em>templatesign</em> is valid, as can be checked using <em>checksig</em> (from the same toolkit) or <a href="http://santuario.apache.org/c/index.html">Oxygen</a>.  However when this token is included as part of an <a href="http://www.nominet.org.uk/enum/enumregistrarsystems/epp/commands/create/">EPP Create command</a>, the signature becomes invalid.  It seems that <em>templatesign</em> doesn&#8217;t do the XML canonicalization quite right.</p>
<blockquote><p>Aside:<br />
To make an XML signature, a digest is taken of the XML data being signed; the data is &#8220;<a href="http://www.w3.org/TR/xml-exc-c14n/">canonicalized</a>&#8221; before calculating the digest.  It seems that canonicalisation is more-or-less just a standard way of inserting whitespace.  I&#8217;m surprised this is how it works because it&#8217;s rather fragile, compared to calculating the digest using the element names, attributes etc &amp; ignoring the formatting.</p></blockquote>
<p>One workaround for this is to run <em>templatesign</em> on the entire Create.  Although this is satisfactory for <a href="http://www.nominet.org.uk/enum/enumregistrarsystems/epp/testbed/">testing</a>, it does not work in the situation where a Validation Agency has to send a signed token to a Registrar, who then wraps this up into a Create command &amp; sends that to Nominet&#8217;s EPP server.</p>
<p>It is possible to use <a href="http://www.oxygenxml.com/">Oxygen</a> to sign a token (<a href="http://www.nominet.org.uk/enum/validationagencies/">example</a>) and this will do the canonicalization in such a way that when enveloped in a Create command, the signature remains valid.  However, Oxygen is an interactive GUI tool and not suited to making an automated system.</p>
<p>Oxygen says that it uses the <a href="http://santuario.apache.org/Java/index.html">Java version of Apache XML Security</a>. Looking at the examples that come with the Apache package (specifically GenEnveloped.java) gives us another option:</p>
<p>We&#8217;ve taken this example from the Apache library and made the appropriate changes to sign an ENUM token. I&#8217;ve packaged some <a href="http://blog.nominet.org.uk/tech/wp-content/uploads/2009/03/enumtokensignexample_20090327.zip" title="enumtokensignexample_20090327.zip">example code</a> <a href="http://blog.nominet.org.uk/tech/wp-content/uploads/2009/03/enumtokensignexample_20090327.zip" title="enumtokensignexample_20090327.zip"><img src="http://blog.nominet.org.uk/tech/wp-content/uploads/2009/03/paperclip_24px.png" alt="paperclip_24px.png" align="middle" border="0" /></a> which contains:</p>
<ul>
<li>EnumTokenSigner.java - signs a token in such a way that it will validate even when enveloped in a Create command.  It takes an unsigned token (as a Java String) for input, signs it and returns the signed token</li>
<li>EnumTokenCreator.java - is one way to create an unsigned token.  This could be done in any number of ways but using a DOM implementation easily handles absent optional elements.</li>
<li>EnumTokenSignExample.java - is a simple test harness - it just loads files &amp; calls the two above utility classes.  You will at least have to edit this to set the path names of the keys &amp; token properties.  It does not (for example) do any of the error-checking that you would expect in production code.</li>
<li>a Makefile</li>
</ul>
<h5>Key formats</h5>
<p>Java uses a different key format (<em>DER</em>) than OpenSSL (<em>PEM</em>).  It is necessary to convert a key+certificate to this format before using the Java tools.  OpenSSL can perform the conversion:</p>
<pre>$ openssl pkcs8 -topk8 -nocrypt -in yourVA_key.key -inform PEM -out yourVA_key.der -outform DER
$ openssl x509 -in yourVA_cert.pem -inform PEM -out yourVA_cert.der -outform DER</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.nominet.org.uk/tech/2009/03/27/signing-enum-xml-tokens/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A New Application Development Architecture</title>
		<link>http://blog.nominet.org.uk/tech/2009/03/20/a-new-application-development-architecure/</link>
		<comments>http://blog.nominet.org.uk/tech/2009/03/20/a-new-application-development-architecure/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 16:12:17 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
		
		<category><![CDATA[Database]]></category>

		<category><![CDATA[Java]]></category>

		<category><![CDATA[Web]]></category>

		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.nominet.org.uk/tech/2009/03/20/a-new-application-development-architecure/</guid>
		<description><![CDATA[I attended the 2009 Hotsos Symposium, an excellent Oracle database performance tuning conference, in Dallas.  The event was a great opportunity to hear world-renowned Oracle performance experts present.
One of the most interesting talks was &#8220;The Helsinki Declaration: A set of Principles for the IT Community regarding Application Development&#8221; by Toon Koppelaars.
Toon described the expansion [...]]]></description>
			<content:encoded><![CDATA[<p>I attended the <a href="http://www.hotsos.com/sym09.html">2009 Hotsos Symposium</a>, an excellent Oracle database performance tuning conference, in Dallas.  The event was a great opportunity to hear world-renowned Oracle performance experts present.</p>
<p>One of the most interesting talks was &#8220;The Helsinki Declaration: A set of Principles for the IT Community regarding Application Development&#8221; by Toon Koppelaars.</p>
<p>Toon described the expansion of features in the Oracle database over the years.  He went on to explain that since the advent of Java, more and more functionality has been implemented outside the database.  However new frameworks, methods and languages are appearing frequently and often disappearing quickly, sometimes within a couple of years.  Many developers are constantly chasing the latest technology because it&#8217;s cool and will allegedly solve all presently-experienced problems.  This leads to code quickly becoming legacy, having to be re-written and/or no developers having the necessary skills to maintain it.  For example how happy or able would your Java developers be to maintain a system built using <a href="http://en.wikipedia.org/wiki/Apache_Struts">Struts</a>, a relatively young framework, but now commonly seen as legacy.  Would they first spend ages rewriting it, these days called <a href="http://en.wikipedia.org/wiki/Refactoring">refactoring</a>, to use <a href="http://en.wikipedia.org/wiki/Spring_Framework">Spring</a>, the effort for which gives no value to the user.</p>
<p>Although these technologies are changing, what users want has not changed; they still largely want &#8220;window on data&#8221; applications.</p>
<p>While this is happening the database technology is remaining stable and under-utilised.</p>
<p>Toon recommends replacing this traditional architecture.  He has successfully deployed systems using a new architecture, named The Helsinki Declaration (that&#8217;s where it was first proposed).  This architecture has a thin user-interface layer, deployed in whatever technology/framework is flavour of the month, and business logic and data logic layers implemented in the comparatively very stable database.  Only the thin user interface is then vulnerable to the latest fad.</p>
<p>This is described well on his <a href="http://thehelsinkideclaration.blogspot.com/">blog</a>.  I recommend starting with his <a href="http://thehelsinkideclaration.blogspot.com/2009/03/helsinki-declaration-observation-1.html">first observation</a> and then proceeding to the <a href="http://thehelsinkideclaration.blogspot.com/2009/03/helsinki-declaration-observation-2.html">second</a>, <a href="http://thehelsinkideclaration.blogspot.com/2009/03/helsinki-declaration-observation-3.html">third</a> and <a href="http://thehelsinkideclaration.blogspot.com/2009/03/helsinki-declaration-observation-4.html">fourth</a> observations.</p>
<p>Talking with conference attendees afterwards I was surprised (or maybe I shouldn&#8217;t have been) by  how many had experienced exactly the issues Toon described on systems development and maintenance projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nominet.org.uk/tech/2009/03/20/a-new-application-development-architecure/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
