<?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>Computer Support &#187; BIND</title>
	<atom:link href="http://www.xiitec.com/blog/tag/bind/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.xiitec.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 30 Dec 2009 08:40:28 +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>Running a Private BIND DNS Server</title>
		<link>http://www.xiitec.com/blog/2008/02/12/running-a-private-bind-dns-server/</link>
		<comments>http://www.xiitec.com/blog/2008/02/12/running-a-private-bind-dns-server/#comments</comments>
		<pubDate>Wed, 13 Feb 2008 05:39:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[BIND]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[private]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=123</guid>
		<description><![CDATA[You&#8217;re tired of dinking around with /etc/hosts;  you&#8217;re ready to implement some grown-up name resolution on your LAN by  installing a BIND DNS server. You only want this server to be available  to your local users, providing both name-resolution and caching  services. It will not provide any public services.

Set up a [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;re tired of dinking around with <em>/etc/hosts</em>;  you&#8217;re ready to implement some grown-up name resolution on your LAN by  installing a BIND DNS server. You only want this server to be available  to your local users, providing both name-resolution and caching  services. It will not provide any public services.</p>
<p><img src="http://www.xiitec.com/blog/wp-includes/js/tinymce/themes/advanced/images/spacer.gif" alt="More..." name="mce_plugin_wordpress_more" width="100%" height="10" id="mce_plugin_wordpress_more" title="More..." moretext="" /></p>
<p>Set up a <a href="http://www.xiitec.com/blog/?p=122" mce_href="http://www.xiitec.com/blog/?p=122" target="_blank">caching name server</a>.  Then add zone blocks to <em>named.conf</em>to  define the new zones for your LAN hosts, and construct the zone files.</p>
<p>Table 1 lists the five hosts on <em>windbag.net</em>.</p>
<table rules="all" width="100%" border="1" cellpadding="4" cellspacing="0">
<thead>
	</thead>
<tr>
<th scope="col">
<p>Address</p>
</th>
<th scope="col">
<p>Hostname</p>
</th>
<th scope="col">
<p>Role</p>
</th>
<th scope="col">
<p>Alias</p>
</th>
<td>
<p>10.11.12.1</p>
</td>
<td>
<p>parsley</p>
</td>
<td>
<p>DNS, mail</p>
</td>
<td> </td>
</tr>
<tr>
<td>
<p>10.11.12.2</p>
</td>
<td>
<p>sage</p>
</td>
<td>
<p>FTP</p>
</td>
<td>
<p>ftp</p>
</td>
</tr>
<tr>
<td>
<p>10.11.12.3</p>
</td>
<td>
<p>rosemary</p>
</td>
<td>
<p>Web server</p>
</td>
<td>
<p>www</p>
</td>
</tr>
<tr>
<td>
<p>10.11.12.4</p>
</td>
<td>
<p>thyme</p>
</td>
<td>
<p>Workstation</p>
</td>
<td> </td>
</tr>
<tr>
<td>
<p>10.11.12.5</p>
</td>
<td>
<p>cilantro</p>
</td>
<td>
<p>Workstation</p>
</td>
<td> </td>
</tr>
<tr>
<td></thead>
</td>
</tr>
</table>
<p>Add these zone blocks to <em>named.conf</em>:</p>
<pre>zone &quot;windbag.net&quot; IN {

  type master;

  file &quot;zone.net.windbag&quot;;

};

zone &quot;12.11.10.in-addr.arpa&quot; {

  type master;

  file &quot;revp.10.11.12&quot;;

};</pre>
<p>Here is the actual zone file for <em>windbag.net</em>:</p>
<pre>// zone.net.windbag

// dns zone for for windbag.net

;

$ORIGIN windbag.net.

$TTL 1D

; any time you make a change to the domain, bump the

; &quot;serial&quot; setting below. the format is easy:

; YYYYMMDDI, with the I being an iterator in case you

; make more than one change during any one day

@     IN SOA   parsley hostmaster (

                        200405191 ; serial

                        8H        ; refresh

                        4H        ; retry

                        4W        ; expire

                        1D )      ; minimum

; parsley.windbag.net serves this domain as both the

; name server (NS) and mail exchange (MX)

                NS      parsley

                MX      10 parsley

; define domain functions with CNAMEs

ftp             CNAME   sage

www             CNAME   rosemary

; just in case someone asks for localhost.windbag.net

localhost       A       127.0.0.1

; our hostnames, in alphabetical order

rosemary            A       10.11.12.3

sage                A       10.11.12.2

parsley             A       10.11.12.1

thyme               A       10.11.12.4

cilantro            A       10.11.12.5</pre>
<p>And finally, here are the reverse lookups for the domain in the <em>revp.10.11.12</em> file:</p>
<pre>; revp.10.11.12

; reverse pointers for 10.11.12.0 subnet

;

$ORIGIN 12.11.10.in-addr.arpa.

$TTL 1D

@     IN SOA  parsley.windbag.net. hostmaster.windbag.net. (

              200405190  ; serial

              28800      ; refresh (8 hours)

              14400      ; retry (4 hours)

              2419200    ; expire (4 weeks)

              86400      ; minimum (1 day)

              )

; define the authoritative name server

              NS      parsley.windbag.net.

; our hosts, in numeric order

1             PTR     parsley.windbag.net.

2             PTR     sage.windbag.net.

3             PTR     rosemary.windbag.net.

4             PTR     thyme.windbag.net.

5             PTR     cilantro.windbag.net.</pre>
<p>Save your changes and restart BIND:</p>
<pre># /etc/init.d/named restart</pre>
<p>And there you are—a shiny new fully functioning DNS server for  your LAN.</p>
<p>&nbsp;</p>
<p>There&#8217;s a whole lot happening in these three files.  First of all, putting each zone into its own file is good organization.  You may dump everything into a single zone file if you like, but you&#8217;ll  find that it&#8217;s difficult to maintain.</p>
<p>In <em>named.conf</em>, the entries for <em>windbag.net</em> tell  BIND that it is the authoritative server for <em>windbag.net</em>, and where to  find the zone files.</p>
<p>The <em>$origin</em> directive is a nice timesaver. It lets you  write:</p>
<pre>$ORIGIN windbag.net.

www           CNAME   rosemary</pre>
<p>instead of:</p>
<pre>www.windbag.net    CNAME     rosemary.windbag.net</pre>
<p><em>$TTL 1D</em> sets a  default time-to-live value. Values can be in this format:</p>
<dl>
<dt>w </dt>
<dd>
<p>For week</p>
</dd>
<dt>d </dt>
<dd>
<p>For day</p>
</dd>
<dt>h </dt>
<dd>
<p>For hour</p>
</dd>
<dt>m </dt>
<dd>
<p>For minute</p>
</dd>
<dt>s </dt>
<dd>
<p>For second</p>
</dd>
</dl>
<p>Individual entries may have their own TTL values:</p>
<pre>rosemary      72h    A       10.11.12.3</pre>
<p>The TTL tells visitors how often to refresh their  own caches. If your site is fairly static, set this to a higher value.  If you&#8217;re making frequent changes, use a lower value. The lower the  TTL, the more hits there will be on your server.</p>
<p><em>@ IN SOA parsley hostmaster</em> means:</p>
<p>&nbsp;</p>
<dl>
<dt><em>@</em> </dt>
<dd>
<p>This holds the same value as $ORIGIN.</p>
</dd>
<dt><em>IN</em> </dt>
<dd>
<p>This defines the address class; IN = Internet.</p>
</dd>
<dt><em>SOA</em> </dt>
<dd>
<p>Start of Authority; the  beginning of a zone file. Only A records can be used as the MNAME—don&#8217;t use  CNAMEs.</p>
</dd>
</dl>
<p>The SOA has 10 fields. These are the primary domain name, zone  class, and SOA, plus the following:</p>
<dl>
<dt><em>MNAME</em> </dt>
<dd>
<p>The master name server for the zone.</p>
</dd>
<dt><em>RNAME</em> </dt>
<dd>
<p>The email address of the domain admin.</p>
</dd>
<dt><em>Serial number</em> </dt>
<dd>
<p>BIND converts zone files into a binary file format.  When you make changes to the zone file, you must also change the serial  number, or BIND will not recognize the changes.</p>
</dd>
<dt><em>Refresh</em> </dt>
<dd>
<p>This tells your slave, or secondary servers how often to check  for updates.</p>
</dd>
<dt><em>Retry</em> </dt>
<dd>
<p>If the master DNS server for the zone fails to  answer a slave server&#8217;s request for an update, this tells the secondary  server how often it should resend the request.</p>
</dd>
<dt><em>Expire</em> </dt>
<dd>
<p>If the master DNS server fails for a longer period  of time, this tells the the secondary server how to continue to use its  existing data. After the expire time has passed, the data is considered  stale and will not be used, at which time the domain will no longer  resolve. Hopefully your master server will be back online before this  happens.</p>
</dd>
<dt><em>Minimum, or Negative-caching TTL</em> </dt>
<dd>
<p>Negative answers (such as when a requested record  does not exist) should also be cached on nonauthoritative servers.  Setting this value prevents your server from getting hammered by a  bunch of repeated requests in a short time. A common use for this is  when you are migrating to a new name server at a different IP address;  setting a short value on the old server a few days before you take it  offline assures that your change will propagate quickly.</p>
</dd>
</dl>
<p>The next section contains <em>resource records</em> (RRs).</p>
<p><em>NS parsley</em> and <em>MX 10 parsley</em> define  your name server and mail server. If you have more than one mail server  for the domain, the number sets the priority. Lower numbers are higher  priority. Because <em>$ORIGIN windbag.net.</em> defines the domain name for the whole record, these  expand to <em>ns.windbag.net</em> and <em>mx.windbag.net</em>.  Make note of the trailing dot—this is very important! That defines the  qualified domain name. If you leave it off, BIND will think it needs to  append the domain name, so you&#8217;ll have silliness like <em>ns.windbag.net.windbag.net.</em></p>
<p>CNAME (canonical name) is an alias to an A record.  Thus, a single A record can have several aliases. You can use a CNAME  to add subdomains for virtual web or mail hosting—for example, <em>programmers.only.domain.com</em> or <em>webmail.domain.com.</em></p>
<p>Instead of using CNAMES, you may assign subdomains  their own A records. This means one less hit on your server per CNAME  request, but it also means more work when you need to make changes.  Endless debates rage over the use of CNAMEs; use what suits you.</p>
<p>&quot;Canonical&quot; is one of those weirdo geek words that  defies a precise, logical definition. In this context, &quot;canonical name&quot;  means &quot;an alias assigned to the true (canonical) name of the server.&quot;</p>
<p>And finally, we come to the A (alias) records. An A  record is the primary address for each of your hosts, the direct match  of hostname to IP address.</p>
<p>Reverse pointers (RPTs) are technically not  required, but in the real world so many servers require them that you  had better use them.</p>
<p>If things are not working right, chances are it&#8217;s a  syntax error or a typo—mind your dots and commas especially. There are  two syntax checkers for BIND to help you.</p>
<p>The other common error is not starting from A  records. Every host must first have an A record. Then you can assign  name servers, mail servers, and CNAMEs.</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/12/running-a-private-bind-dns-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running a Local Caching Name Server with BIND</title>
		<link>http://www.xiitec.com/blog/2008/02/12/running-a-local-caching-name-server-with-bind/</link>
		<comments>http://www.xiitec.com/blog/2008/02/12/running-a-local-caching-name-server-with-bind/#comments</comments>
		<pubDate>Wed, 13 Feb 2008 05:35:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[BIND]]></category>
		<category><![CDATA[DNS]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=122</guid>
		<description><![CDATA[You want  to set up a local BIND caching name server for your LAN to speed up DNS  lookups, which in turn will speed up all of your Internet services.

&#160;
Install BIND on a Linux machine with a static IP  address. Be sure you get the latest version. Don&#8217;t mess with older  [...]]]></description>
			<content:encoded><![CDATA[<p>You want  to set up a local BIND caching name server for your LAN to speed up DNS  lookups, which in turn will speed up all of your Internet services.</p>
<p><img src="http://www.xiitec.com/blog/wp-includes/js/tinymce/themes/advanced/images/spacer.gif" alt="More..." name="mce_plugin_wordpress_more" width="100%" height="10" id="mce_plugin_wordpress_more" title="More..." moretext="" /></p>
<p>&nbsp;</p>
<p>Install BIND on a Linux machine with a static IP  address. Be sure you get the latest version. Don&#8217;t mess with older  versions, as they are buggy and exploitable. After installation, you&#8217;ll  have four configuration files to edit or create:</p>
<ul>
<li><em>named.conf</em></li>
<li><em>named.root</em></li>
<li><em>zone.localhost</em></li>
<li><em>revp.127.0.0</em></li>
</ul>
<p>Al of these files are in <em>/var/named, </em>except for <em>/etc/named.conf.</em> <em>named.conf</em>is  the standard name for BIND&#8217;s configuration file; all the others you can name to  suit yourself. Here is a sample <em>named.conf</em>:</p>
<pre>//BIND configuration file

//named.conf for caching server

options {

// where all zone files are

  directory &quot;/var/named&quot;;

// accept queries only from local subnet

  listen-on {

           127.0.0.1;

           10.11.12.1;

    };

  allow-recursion {

           127.0.0.0/8;

           10.11.12.0/24;

    };

};

zone &quot;.&quot; IN {

     type hint;

     file &quot;named.root&quot;;

};

// location of the zone file for localhost

zone &quot;localhost&quot; IN {

  type master;

  file &quot;zone.localhost&quot;;

  allow-update { none; };

};

// reverse pointer file for localhost

zone &quot;0.0.127.in-addr.arpa&quot; IN {

  type master;

  file &quot;revp.127.0.0&quot;;

  allow-update { none; };

};</pre>
<p>Now add <em>named.root.</em>This is the master list of the root name  servers; simply fetch the current version from <a href="ftp://ftp.internic.net/domain/named.root" mce_href="ftp://ftp.internic.net/domain/named.root" target="_blank">ftp://ftp.internic.net/domain/named.root</a>, and put it in <em>/var/named</em>.</p>
<p>Now create <em>zone.localhost</em>:</p>
<pre>; zone.localhost

; loopback/localhost zone file

;

$TTL 1D

$ORIGIN localhost.

@              IN  SOA   @  root (

                         1   ; Serial

                         8H  ; Refresh

                         15M ; Retry

                         1W  ; Expire

                         1D) ; Minimum TTL

               IN   NS   @

               IN   A    127.0.0.1</pre>
<p>Finally, create <em>revp.127.0.0</em>:</p>
<pre>; revp.127.0.0

; reverse pointers for localhost

;

$TTL 1D

$ORIGIN 0.0.127.in-addr.arpa.

@    IN   SOA  localhost. root.localhost. (

               1    ; serial

               8H   ; refresh

               15M  ; retry

               1W   ; expire

               1D ) ; minimum

     IN   NS   localhost.

1    IN   PTR  localhost.</pre>
<p>Then start up BIND:</p>
<pre># /etc/init.d/named start</pre>
<p>You now have a local caching name server. See <a href="http://www.xiitec.com/blog/?p=117" mce_href="http://www.xiitec.com/blog/?p=117" target="_blank">this </a>to learn how to connect client PCs to your caching server.</p>
<p>&nbsp;</p>
<p><em>named</em> is short  for &quot;name daemon.&quot;</p>
<p>BIND configuration files can grow and multiply like  weeds, so using a naming convention like the one shown here will save  your sanity. Zone files each start with &quot;zone,&quot; and reverse pointer  files start with &quot;revp.&quot; You may call them anything you want, as long  as you use a consistent naming scheme.</p>
<p>You can use each one of these sample files exactly as they are  shown. The only change you might need to make is the <em>listen-on</em> directive  in <em>named.conf</em>—be sure to use your own network IP addresses. Leave <em>localhost</em> exactly as it is shown, unless you&#8217;re using some exotic networking  voodoo, in which case you already know what to do. Do not allow traffic  from outside your network! There is no reason for you to supply caching  services to the world.</p>
<p>The <em>named.root </em>filedoes not change  very often. Check it every few months just for kicks. You may call it  anything you like, as long as you record the filename in <em>named.conf</em>.</p>
<p><em>zone.localhost </em>tells <em>named</em> that the address of  localhost is 127.0.0.1.</p>
<p><em>revp.127.0.0</em> does the opposite of <em>zone.localhost</em>—it tells <em>named</em> that the hostname associated with  the IP address 127.0.0.1 is localhost.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/12/running-a-local-caching-name-server-with-bind/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

