<?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>rajaseelan.com &#187; chroot</title>
	<atom:link href="http://rajaseelan.com/tag/chroot/feed/" rel="self" type="application/rss+xml" />
	<link>http://rajaseelan.com</link>
	<description>junk food for the brain ...</description>
	<lastBuildDate>Tue, 28 Jul 2009 16:37:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Configure a Caching-Only Name Server in a Chroot Environment for Fedora 11</title>
		<link>http://rajaseelan.com/2009/07/18/configure-a-caching-only-name-server-in-a-chroot-environment-for-fedora-11/</link>
		<comments>http://rajaseelan.com/2009/07/18/configure-a-caching-only-name-server-in-a-chroot-environment-for-fedora-11/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 12:39:35 +0000</pubDate>
		<dc:creator>raja</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[caching-nameserver]]></category>
		<category><![CDATA[caching-only]]></category>
		<category><![CDATA[chroot]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[fedora 11]]></category>
		<category><![CDATA[named]]></category>
		<category><![CDATA[nameserver]]></category>

		<guid isPermaLink="false">http://rajaseelan.com/?p=231</guid>
		<description><![CDATA[Having a caching only name-server on your local Machine speeds up your browsing. Here&#8217;s how to set up a slightly more secure caching server using ISC Bind in Fedora 11.

Install bind and bind-chroot packages


# yum install bind bind-chroot



Edit your /etc/sysconfig/named file.


# vim /etc/sysconfig/named


Add the following line:


ROOTDIR=&#34;/var/named/chroot&#34;



Edit your /etc/named.conf file.


# vim /etc/named.conf



Change the following line:


listen-on port [...]]]></description>
			<content:encoded><![CDATA[<p>Having a caching only name-server on your local Machine speeds up your browsing. Here&#8217;s how to set up a slightly more secure caching server using ISC Bind in Fedora 11.</p>
<ol>
<li>Install <code>bind</code> and <code>bind-chroot</code> packages
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;"># yum install bind bind-chroot</pre>
</div>
</div>
</li>
<li>Edit your <code>/etc/sysconfig/named file.
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;"># vim /etc/sysconfig/named</pre>
</div>
</div>
<p>Add the following line:</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">ROOTDIR=&quot;/var/named/chroot&quot;</pre>
</div>
</div>
<p></code></li>
<li>Edit your <code>/etc/named.conf</code> file.
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;"># vim /etc/named.conf</pre>
</div>
</div>
</li>
<li>Change the following line:
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">listen-on port 53 { 127.0.0.1; };</pre>
</div>
</div>
<p>to</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">listen-on port 53 { any; };</pre>
</div>
</div>
<p>This allows the bind daemon to listen on all your network IPs, not just your loopback(127.0.0.1) address.</li>
<li>Change this line:
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">allow-query     { localhost; };</pre>
</div>
</div>
<p>to</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">allow-query     { 192.168.0.0/24; };</pre>
</div>
</div>
<p>You now allow all the machines in your home LAN to use your DNS server.
</li>
<li>Make sure it starts at boot time.
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;"># chkconfig named on</pre>
</div>
</div>
<p>Restart your DNS server.</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;"># service named restart</pre>
</div>
</div>
</li>
<li>Make sure its listening on the correct ports.
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;"># netstat -ntupl | grep named</pre>
</div>
</div>
<p>In my case, the DNS server IP is 192.168.0.10. So, as seen here, the line <code>udp        0      0 192.168.0.10:53       0.0.0.0:*      2851/named</code> shows it is listening correctly.</li>
<li>Then test your server from another machine in your network. Most probably another linux box or laptop.
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;"># dig @192.168.0.10 google.com</pre>
</div>
</div>
<p>The dig command, with the &#8216;@&#8217; instructs it to get the IP address for google.com from your newly set up server. On my machine, it looked like this:-</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">[root@atreides ~]# dig @192.168.0.10 google.com
&nbsp;
; &lt; &lt;&gt;&gt; DiG 9.6.1-RedHat-9.6.1-2.fc11 &lt; &lt;&gt;&gt; @192.168.0.10 google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; -&gt;&gt;HEADER&lt; &lt;- opcode: QUERY, status: NOERROR, id: 6515
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 0
&nbsp;
;; QUESTION SECTION:
;google.com.			IN	A
&nbsp;
;; ANSWER SECTION:
google.com.		300	IN	A	74.125.127.100
google.com.		300	IN	A	74.125.45.100
google.com.		300	IN	A	74.125.67.100
&nbsp;
;; AUTHORITY SECTION:
google.com.		171853	IN	NS	ns3.google.com.
google.com.		171853	IN	NS	ns1.google.com.
google.com.		171853	IN	NS	ns2.google.com.
google.com.		171853	IN	NS	ns4.google.com.
&nbsp;
;; Query time: 82 msec
;; SERVER: 192.168.0.10#53(192.168.0.10)
;; WHEN: Sat Jul 18 20:14:59 2009
;; MSG SIZE  rcvd: 148</pre>
</div>
</div>
<p>Note the <code>SERVER:</code> line. that shows you the answer for the query came from my DNS server (192.168.0.10).
</pre>
</li>
<li>Finally, set up your <code>/etc/resolv.conf</code> accordingly.
<p>On the server:</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">nameserver 127.0.0.1</pre>
</div>
</div>
<p>And on all your other machines:</p>
<div class="wp_syntax">
<div class="code">
<pre class="text" style="font-family:monospace;">nameserver 192.168.0.10</pre>
</div>
</div>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://rajaseelan.com/2009/07/18/configure-a-caching-only-name-server-in-a-chroot-environment-for-fedora-11/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
