<?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; private</title>
	<atom:link href="http://www.xiitec.com/blog/tag/private/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>
	</channel>
</rss>

