<?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>About Web Development by Activo &#187; DNS proxy</title>
	<atom:link href="http://www.activoinc.com/blog/tag/dns-proxy/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.activoinc.com/blog</link>
	<description>Web Development in a Web 2.0 World</description>
	<lastBuildDate>Fri, 29 Jan 2010 17:16:07 +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>pdnsd &#8211; Decrease DNS response time and save bandwidth</title>
		<link>http://www.activoinc.com/blog/2008/12/25/pdnsd-decrease-dns-response-time-and-save-bandwidth/</link>
		<comments>http://www.activoinc.com/blog/2008/12/25/pdnsd-decrease-dns-response-time-and-save-bandwidth/#comments</comments>
		<pubDate>Fri, 26 Dec 2008 07:55:11 +0000</pubDate>
		<dc:creator>Ron Peled</dc:creator>
				<category><![CDATA[LAMP: Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Performance Optimization]]></category>
		<category><![CDATA[Web Application Hosting]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[DNS caching]]></category>
		<category><![CDATA[DNS proxy]]></category>
		<category><![CDATA[pdnsd]]></category>

		<guid isPermaLink="false">http://www.activoinc.com/blog/?p=162</guid>
		<description><![CDATA[Sometimes, when you realize that you could have improved the system with so little effort, we blush. This is what happened to me when I realized that most of the neworking delays could have been avoided with this tiny but wity utility. I knew that having a local caching DNS or the like is the [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, when you realize that you could have improved the system with so little effort, we blush. This is what happened to me when I realized that most of the neworking delays could have been avoided with this tiny but wity utility. I knew that having a local caching DNS or the like is the answer but I did not want to use a full fletched DNS server. I found <a title="pdnsd - a small proxy DNS server with permanent caching" href="http://www.phys.uu.nl/~rombouts/pdnsd/index.html"><strong>pdnsd</strong></a> &#8211; a small proxy DNS server with permanent caching. Perfect!</p>
<p><img class="alignnone size-full wp-image-166" title="bandwidth-savings-with-pdnsd" src="http://www.activoinc.com/blog/wp-content/uploads/2008/12/bandwidth-savings-with-pdnsd.jpg" alt="" width="470" height="314" /></p>
<p>In a nutshel, <strong>pdnsd</strong> is a small utility that caches DNS translations locally on the HD, hence next time the server queries the address the response time is likely to be minimal. Usually, the server has to query your ISP&#8217;s DNS or whatever DNS server you specified in the /etc/resolve.conf file. In a high performing web servers you are constantly competing with other packets on the network or your network resources. This is a great advantage. By installing pdnsd you achieve the following:</p>
<ul>
<li>Decrease the average DNS response time sharply!</li>
<li>Increase your server performance, especially if this server needs to communicate externally a lot like an eCommerce server which constantly needs to communicate with shipping and credit card servers.</li>
<li>Save on bandwidth.</li>
</ul>
<p>Here is how you go about setting up <strong>pdnsd</strong> on a CentOS server:</p>
<p><strong>1. Download the latest stable rpm</strong>:<br />
go to <a href="http://www.phys.uu.nl/~rombouts/pdnsd/dl.html">pdnsd download page</a> and look for your relevant rpm. For CentOS 5.2 64bit I got the latest version as of yesterday:</p>
<pre>wget http://www.phys.uu.nl/~rombouts/pdnsd/releases/pdnsd-1.2.7-par_sl5.x86_64.rpm</pre>
<p><strong> 2. Install the rpm:</strong></p>
<pre>rpm -i pdnsd-1.2.7-par_sl5.x86_64.rpm</pre>
<p><strong>3. Configure pdnsd to use your current DNS servers:</strong></p>
<pre>vi /etc/pdnsd.conf</pre>
<p>Paste the following, of-course you should use your DNS servers instead:</p>
<pre>server {
label="opendns";
ip = 208.67.222.222,208.67.220.220;
}</pre>
<p><strong>4. Start pdnsd and test that it is actually working</strong></p>
<pre>service pdnsd start</pre>
<pre> dig @127.0.0.1 yahoo.com</pre>
<p>If you get the IP, it is working. Notice the response time, if you try again you will see a sharp decrease in response time. My servers&#8217; second response time is almost always between 1-0 ms.</p>
<p><strong>5. Set pdnsd to start automatically on boot</strong></p>
<pre>vi /etc/default/pdnsd</pre>
<p>Enter the following and save:</p>
<pre>START_DAEMON=yes</pre>
<p>Also make sure the daemon is set to auto start on boot. I use &#8216;ntsysv&#8217;, you can use chkconfig or whatever you are used to.</p>
<p><strong>6. Set your server to use the pdnsd instead of your DNS servers</strong></p>
<pre>vi /etc/resolv.conf</pre>
<p>Make sure that the first nameserver line is &#8216;127.0.0.1&#8242;. Should look like this:</p>
<pre>nameserver 127.0.0.1</pre>
<p><strong>7. Restart your network service:</strong></p>
<pre>service network restart</pre>
<p>How do you know that it is working? try to use any script that needs to go outside to the network, like &#8216;yum update&#8217;. In most cases, you will notice that the second time is much faster. Enjoy!</p>
<h3  class="related_post_title">Related Posts</h3><ul class="related_post"><li>September 3, 2009 -- <a href="http://www.activoinc.com/blog/2009/09/03/quick-way-to-update-fail2ban-jail-conf-file/" title="Quick Way to Update Fail2ban jail.conf file">Quick Way to Update Fail2ban jail.conf file</a> (0)</li><li>August 31, 2009 -- <a href="http://www.activoinc.com/blog/2009/08/31/performance-optimized-httpd-conf-for-magento-ecommerce/" title="Performance Optimized httpd.conf for Magento eCommerce">Performance Optimized httpd.conf for Magento eCommerce</a> (0)</li><li>August 24, 2009 -- <a href="http://www.activoinc.com/blog/2009/08/24/howto-setup-iptables-for-www-and-dbmysql-on-linux/" title="Howto setup iptables for www and db(mysql) on linux">Howto setup iptables for www and db(mysql) on linux</a> (0)</li><li>August 23, 2009 -- <a href="http://www.activoinc.com/blog/2009/08/23/centos-5-3-install-essentials/" title="CentOS 5.3 Install Essentials">CentOS 5.3 Install Essentials</a> (0)</li><li>August 3, 2009 -- <a href="http://www.activoinc.com/blog/2009/08/03/block-access-to-your-dedicated-server-automatically-if-more-than-3-failed-logins/" title="Block access to your dedicated server automatically if more than 3 failed logins">Block access to your dedicated server automatically if more than 3 failed logins</a> (0)</li><li>July 16, 2009 -- <a href="http://www.activoinc.com/blog/2009/07/16/speed-optimized-websites-rank-higher-with-search-engines/" title="Speed Optimized Websites Rank Higher with Search Engines">Speed Optimized Websites Rank Higher with Search Engines</a> (0)</li><li>March 27, 2009 -- <a href="http://www.activoinc.com/blog/2009/03/27/recommended-visual-svn-server-now-with-subversion-16/" title="Recommended: Visual SVN Server, now with Subversion 1.6">Recommended: Visual SVN Server, now with Subversion 1.6</a> (1)</li><li>March 25, 2009 -- <a href="http://www.activoinc.com/blog/2009/03/25/tightening-up-iptables-for-a-dedicated-db-server-mysql-and-centos/" title="Tightening up iptables for a dedicated DB server (MySQL and CentOS)">Tightening up iptables for a dedicated DB server (MySQL and CentOS)</a> (1)</li><li>November 30, 2008 -- <a href="http://www.activoinc.com/blog/2008/11/30/centos-for-linux-servers-a-cut-above/" title="CentOS for Linux Servers: a cut above">CentOS for Linux Servers: a cut above</a> (0)</li><li>November 5, 2008 -- <a href="http://www.activoinc.com/blog/2008/11/05/understanding-mysql-query-caching/" title="Understanding MySQL Query Caching Process">Understanding MySQL Query Caching Process</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.activoinc.com/blog/2008/12/25/pdnsd-decrease-dns-response-time-and-save-bandwidth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
