<?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>thinking sysadmin &#187; dns</title>
	<atom:link href="http://andyleonard.com/tag/dns/feed/" rel="self" type="application/rss+xml" />
	<link>http://andyleonard.com</link>
	<description>qstat -u aleonard -s z</description>
	<lastBuildDate>Fri, 30 Jul 2010 17:47:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Test Driving Google Public DNS (Updated with OpenDNS comparison)</title>
		<link>http://andyleonard.com/2009/12/03/test-driving-google-publi-dns/</link>
		<comments>http://andyleonard.com/2009/12/03/test-driving-google-publi-dns/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 19:31:16 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[comcast]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[opendns]]></category>

		<guid isPermaLink="false">http://andyleonard.com/?p=414</guid>
		<description><![CDATA[Google announced its Public DNS service this morning, claiming enhanced performance and security; I took it for a brief test drive with the following results.
(See bottom of post for an update running similar tests on OpenDNS.)
Methods: I searched Google for keywords that I believed fell somewhere between obscure and common and collected the first ten [...]]]></description>
			<content:encoded><![CDATA[<p>Google announced its <a href="http://code.google.com/speed/public-dns/">Public DNS</a> service this morning, claiming enhanced <a href="http://code.google.com/speed/public-dns/docs/performance.html">performance</a> and <a href="http://code.google.com/speed/public-dns/docs/security.html">security</a>; I took it for a brief test drive with the following results.</p>
<p>(See bottom of post for an update running similar tests on OpenDNS.)</p>
<p><strong>Methods:</strong> I searched Google for <a href="http://www.google.com/search?q=lightweight+backpacking">keywords</a> that I believed fell somewhere between obscure and common and collected the first ten hostnames printed on the screen.  I then used local installations of dig to query a collection of DNS servers for the hostnames&#8217; A records and collected the response times.  The different resolvers used were:</p>
<ul>
<li>A local BIND installation (127.0.0.1, cache empty) with Comcast Internet connectivity;</li>
<li>A Comcast DNS server (68.87.69.150) via Comcast Internet connectivity;</li>
<li>My employer&#8217;s internal caching DNS;</li>
<li>Google (8.8.8.8) via my employer&#8217;s Internet connectivity (mostly Level 3);</li>
<li>Google (8.8.8.8) via Comcast; and</li>
<li>Google (8.8.8.8) via an Amazon EC2 instance in us-east-1a.</li>
</ul>
<p>Anticipating a bimodal distribution of results, I assumed high latency responses were cache misses, while low latency responses were cache hits, and categorized results correspondingly.<br />
<span id="more-414"></span><br />
<strong>Limitations:</strong> Chiefly, the small number of hostnames queried.  Results from a larger group of domains would be more conclusive.</p>
<p><strong>Results:</strong> Given in the format of Server/Connectivity: Cache Miss/Cache Hit</p>
<ul>
<li>Local BIND server/Comcast: 319ms/0ms</li>
<li>Comcast/Comcast: 166ms/14ms</li>
<li>Google/Comcast: no misses/73ms</li>
<li>Employer/Level 3: 235ms/30ms</li>
<li>Google/Level 3: 204ms/44ms</li>
<li>Google/EC2: 190ms/4ms</li>
</ul>
<p>I concluded that Google/Comcast had no misses by testing another set of obscure hostnames twice each, noting that the first query was slower (~120ms) and the second query was similar in latency to the results above (70ms).  (My belief is that I inadvertently pre-populated the cache for Google/Comcast by my tests elsewhere.)</p>
<p><strong>Discussion:</strong></p>
<ul>
<li><strong>It&#8217;s all about cache hits.</strong>  Whichever resolver gives you the most cache hits will give you the best performance; cache misses are at least an order of magnitude slower than cache hits.  In this extremely limited test, the cache-hits-champion appears to be Google.  Excluding Google/Comcast, where I believe I pre-populated Google&#8217;s cache, Google had a 50% cache hit rate, while Comcast and my Employer only hit 20%.
<li><strong>Location, location, location.</strong>  Secondary to cache hits, the closer the resolver is to you, the better.  Looking at the Comcast results, it&#8217;s hard to get closer than localhost, and, as seems logical, Comcast&#8217;s resolvers have lower cached latency than Google&#8217;s.  <strong>Running a local caching resolver forwarding to Google may be a desirable configuration.</strong></li>
<li><strong>Resolver behavior matters.</strong>  Comcast is notorious for <a href="http://www.dslreports.com/shownews/Comcast-DNS-Redirection-Goes-Nationwide-103762">poor behavior</a>.  It&#8217;s reasonable to expect that Google will be mining your DNS query data.  <strong>Running a slower but directly-controlled local, non-forwarding server may be preferable for privacy and security reasons.</strong></li>
</ul>
<p><strong>Update:</strong>  At the <a href="http://twitter.com/tscalzott/status/6313122948">suggestion</a> of <a href="http://twitter.com/tscalzott">@tscalzott</a>, I researched OpenDNS&#8217;s performance with the same set of hostnames via the same connectivity on their DNS resolvers at 208.67.222.222.  This time, however, I queried the A record for each hostname twice in rapid succession to ascertain how many of my queries were served from OpenDNS&#8217;s cache.  Results are in the format:</p>
<p>DNS Server/Connectivity: Cache miss/Cache hit &#8211; cache hit rate</p>
<ul>
<li>OpenDNS/Comcast: 218ms/30ms &#8211; 20%</li>
<li>OpenDNS/EC2: 144ms/2ms &#8211; 10%</li>
<li>OpenDNS/Level 3: 230ms/4ms &#8211; 40%</li>
</ul>
<p>Compared to Google, OpenDNS had similar latency for cache misses and lower latency for cache hits, but appears to possibly have a lower cache hit rate.  It seems likely that the latency &#8220;winner&#8221; for each user&#8217;s individual situation will depend on where they are on the Internet relative to the nearest Google and OpenDNS installations.  Google&#8217;s greater cache hit rate suggests it may offer better service, but testing a larger number of hostnames would be necessary before being able to state that with any certainty.</p>
<p><strong>Disclosure:</strong> I use Google&#8217;s free Apps services to host personal email, and I use their public sites (Search, Reader, News, Analytics, etc.) extensively.  I recently attended a Google Apps for the Enterprise dog-and-pony show where I received a number of small tchotchkes; my wife took the notebook, I kept the pen and binder and threw the rest away.  My employer uses Postini.  I tried OpenDNS briefly several months back, but did not use them long-term because of limitations in my own configuration.</p>
]]></content:encoded>
			<wfw:commentRss>http://andyleonard.com/2009/12/03/test-driving-google-publi-dns/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Migrating from self-hosted email to Google Apps for Domains</title>
		<link>http://andyleonard.com/2009/11/24/migrating-from-self-hosted-email-to-google-apps-for-domains/</link>
		<comments>http://andyleonard.com/2009/11/24/migrating-from-self-hosted-email-to-google-apps-for-domains/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 03:01:40 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[personal tech]]></category>
		<category><![CDATA[utility computing]]></category>
		<category><![CDATA[cyrus]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[imap]]></category>
		<category><![CDATA[imapsync]]></category>

		<guid isPermaLink="false">http://andyleonard.com/?p=366</guid>
		<description><![CDATA[I recently moved my personal email from a self-managed Exim/Cyrus setup on a dedicated FreeBSD server to Gmail (Google Apps for Domains).  This migration was motivated by a desire to reduce expenses, reduce time spent managing mail software and the importance of email (for me, personally) dropping to a level where I was willing [...]]]></description>
			<content:encoded><![CDATA[<p>I recently moved my personal email from a self-managed Exim/Cyrus setup on a dedicated FreeBSD server to Gmail (<a href="http://www.google.com/apps/intl/en/group/index.html">Google Apps for Domains</a>).  This migration was motivated by a desire to reduce expenses, reduce time spent managing mail software and the importance of email (for me, personally) dropping to a level where I was willing to accept the risks inherent in outsourcing it.  Details of the exact process I used to migrate mail are below.</p>
<p><strong>Assumptions:</strong> An IMAP interface to your current email, basic comptency at managing DNS, and the ability to run the <a href="http://www.linux-france.org/prj/imapsync/README">imapsync</a> Perl script (built via FreeBSD ports in my case, but installation should be straightforward under most UNIX or Linux systems).<br />
<span id="more-366"></span><br />
<strong>0.</strong> Ensure your domain registration is up to date and with a reputable registrar (Pro tip: if you have to wade through pages of deceptive and needless up-sells with your registrar, they&#8217;re not reputable), and fully independent from anything you have set up with Google.  Ensure your DNS configuration is completely correct; if you&#8217;re unsure whether or not it is, buy a membership at <a href="http://www.dnsstuff.com/">DNSstuff</a>, run its tests on your domains, and fix the relevant problems.  If you don&#8217;t fully host your own DNS &#8211; and chances are, if you&#8217;re outsourcing your email, you probably don&#8217;t host your own DNS &#8211; I recommend using two independent DNS providers.  Hosted DNS service that&#8217;s worth spending money with will be able to function as a secondary and allow zone transfers &#8211; and, while you&#8217;re at it, make sure your chosen provider supports <a href="http://www.rfc-archive.org/getrfc.php?rfc=1996">DNS NOTIFY</a> &#8211; it&#8217;ll make changing your MX records in a timely fashion that much easier.  Whatever you do, don&#8217;t use your registrar&#8217;s DNS servers.</p>
<p>You occasionally see <a href="http://discuss.joelonsoftware.com/default.asp?biz.5.730915.0">sad tales of Google Apps woe</a> which could have been mitigated by independent domain registration and a moderate knowledge of DNS.  Don&#8217;t risk becoming another bitter messageboard-posting statistic.</p>
<p>In summary: Don&#8217;t understand DNS or don&#8217;t have time for it?  Stop reading now; either hire a consultant to do the work, or accept that outsourced email probably isn&#8217;t right for you.</p>
<p><strong>0.1.</strong> This goes hand-in-hand with step 0 above: Have an off-Google backup system for your email &#8211; one that runs unattended, automatically, just like a &#8220;real&#8221; backup system would be.  Google has its strong points, but customer service for their free products isn&#8217;t one of them.  If Google should update their <a href="http://en.wikipedia.org/wiki/Don%27t_be_evil">unofficial motto</a> to a more succinct &#8220;be evil&#8221; you want to have an &#8220;out&#8221; and the ability to migrate your mail elsewhere.  Imapsync, linked to above and described below, can be adapted for this purpose.</p>
<p><strong>0.2</strong> Install and test imapsync before beginning this process.  This is the best tool that I&#8217;ve found for syncing mailboxes between servers; all others I tried were unreliable, and documentation below will be specific to it.  In theory, another tool could work &#8211; IMAP is IMAP and a standard &#8211; but I leave using other migration tools as an exercise for the reader.</p>
<p><strong>1.</strong> Drop your MX record TTL to a suitably low value; I used 60 seconds during my migration.  Let the older, presumably greater TTL age off prior to making any further changes to your MX records (as in step 7 below).</p>
<p><strong>2.</strong> <a href="http://www.google.com/a/cpanel/domain/new">Sign up</a> your domain for Google Apps, and use DNS to verify control.</p>
<p><strong>3.</strong> Create users for the domain, and accept terms.  A best practice would be to use different passwords on Gmail from what users currently have, and do note that you will need both old and new passwords for the synchronization step.  (If you are currently running a Cyrus IMAP server with sasldb, passwords can be extracted by running &#8220;db3_dump185 -p sasldb2.db&#8221; as a user that can read sasldb.)</p>
<p><strong>4.</strong> In the Google Apps control panel, create distribution lists and aliases (&#8220;nicknames&#8221;) for your users as appropriate.</p>
<p><strong>5.</strong> For each Gmail mailbox, enable IMAP: Settings > Forwarding and POP/IMAP: Enable IMAP.</p>
<p><strong>6.</strong> If appropriate (and assuming you have other users in your domain), have users verify their logins and familiarize themselves with Gmail&#8217;s options.</p>
<p><strong>7.</strong> Change your <a href="http://www.google.com/support/a/bin/answer.py?answer=33352">MX records</a> to point to Google; keep your TTL low in case you need to change back to your old servers.</p>
<p><strong>8.</strong> Verify delivery to your new Gmail mailboxes by sending test messages from a third-party address.</p>
<p><strong>9.</strong> Set an appropriate <a href="http://www.google.com/support/a/bin/answer.py?hl=en&#038;answer=33786">SPF record</a> for your domain in DNS.</p>
<p><strong>10.</strong> Sync your old mailboxes with your new; I recommend running imapsync directly on your mail server, if possible, for best performance.  Example imapsync session for a Cyrus inbox:</p>
<p><code>imapsync --host1 mail.example.com --port1 143 --user1 user@example.com --password1 [...] --prefix1 INBOX. --host2 imap.gmail.com --port2 993 --user2 user@example.com --password2 [...] --ssl2 --folder INBOX</code></p>
<p>(Insert passwords as appropriate.)</p>
<p>Example imapsync session for a Cyrus folder other than the inbox:</p>
<p><code>imapsync --host1 mail.example.com --port1 143 --user1 user@example.com --password1 [...] --prefix1 INBOX. --host2 imap.gmail.com --port2 993 --user2 user@example.com --password2 [...] --ssl2 --folder INBOX.saved-messages</code></p>
<p>Note that Gmail has certain reserved labels that you cannot sync directly to, such as &#8220;Sent&#8221;.  In this case, you&#8217;ll need to use the &#8220;regextrans2&#8243; flag to sync to a different folder:</p>
<p><code>imapsync --host1 mail.example.com --port1 143 --user1 user@example.com --password1 [...] --prefix1 INBOX. --host2 imap.gmail.com --port2 993 --user2 use@example.com --password2 [...] --ssl2 --folder INBOX.Sent --regextrans2 's/Sent/Old-Sent/'</code></p>
<p><strong>11.</strong> After double checking that your old MX record&#8217;s TTL has passed, and no new mail is being delivered to your old mail server, decommission it as necessary.</p>
]]></content:encoded>
			<wfw:commentRss>http://andyleonard.com/2009/11/24/migrating-from-self-hosted-email-to-google-apps-for-domains/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thought you fixed that DNS spoofing bug?  You might need to think again.</title>
		<link>http://andyleonard.com/2008/07/27/thought-you-fixed-that-dns-spoofing-bug-you-might-need-to-think-again/</link>
		<comments>http://andyleonard.com/2008/07/27/thought-you-fixed-that-dns-spoofing-bug-you-might-need-to-think-again/#comments</comments>
		<pubDate>Sun, 27 Jul 2008 15:14:21 +0000</pubDate>
		<dc:creator>Andy</dc:creator>
				<category><![CDATA[security]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[nat]]></category>
		<category><![CDATA[spoofing]]></category>

		<guid isPermaLink="false">http://andyleonard.com/?p=55</guid>
		<description><![CDATA[So you thought you fixed the DNS spoofing vulnerability that was all over the news this month?  You applied the patches and moved on to the other fifty-seven things crowded on your to-do list, thinking that you were safe?  If your resolvers are behind a NAT, you might want to think again, smart [...]]]></description>
			<content:encoded><![CDATA[<p>So you thought you fixed the <a href="http://www.doxpara.com/?p=1185">DNS spoofing vulnerability</a> that was all over the news this month?  You applied the patches and moved on to the other fifty-seven things crowded on your to-do list, thinking that you were safe?  If your resolvers are behind a NAT, you might want to <a href="http://blogs.iss.net/archive/dnsnat.html">think again</a>, smart guy.<br />
<span id="more-55"></span><br />
In a nutshell, your handy-dandy NAT box is quite possibly making your resolver&#8217;s now-random UDP source ports sequential, making you vulnerable again.  The only &#8220;vendors&#8221; I&#8217;m aware of that don&#8217;t have this issue are Linux&#8217;s IPTables and OpenBSD&#8217;s PF (also available on FreeBSD, of course) &#8211; funny that, since those guys aren&#8217;t really vendors at all.  I could be just ignorant or looking in the wrong place, but this doesn&#8217;t even seem to be on <a href="http://www.cisco.com/web/about/security/intelligence/dns-bcp.html">Cisco&#8217;s radar</a> right now, for example.</p>
<p>The tester in the sidebar at <a href="http://www.doxpara.com/">DoxPara Research</a> seems to do a good job of testing your configuration end-to-end for this vulnerability.</p>
<p>(File this under &#8220;Just another reason why NAT is evil.&#8221;)</p>
]]></content:encoded>
			<wfw:commentRss>http://andyleonard.com/2008/07/27/thought-you-fixed-that-dns-spoofing-bug-you-might-need-to-think-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
