<?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; DNS</title>
	<atom:link href="http://www.xiitec.com/blog/tag/dns/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>Building Your Own DNS Blackhole List</title>
		<link>http://www.xiitec.com/blog/2009/02/12/building-your-own-dns-blackhole-list/</link>
		<comments>http://www.xiitec.com/blog/2009/02/12/building-your-own-dns-blackhole-list/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 18:48:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[blackhole]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[DNS]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=245</guid>
		<description><![CDATA[The domain administrator must create a DNS zone file, in the   proper format, that lists all of the connection addresses that are to be   blacklisted. The special DNS address records in the zone file are constructed by   reversing the IP address of the blacklisted system to create the DNS [...]]]></description>
			<content:encoded><![CDATA[<p>The domain administrator must create a DNS zone file, in the   proper format, that lists all of the connection addresses that are to be   blacklisted. The special DNS address records in the zone file are constructed by   reversing the IP address of the blacklisted system to create the DNS name field   of the record and by using an address such as 127.0.0.2 in the data   field of the address record. This format means that hosts are blacklisted by IP   address instead of by name, which makes sense because the <em>dnsbl</em> lookup is   done using the connection IP address. The DNS server must be authoritative for   the domain in which the blackhole list is to be located. This is normally done   by creating a special subdomain for the blackhole list within the zone of   authority of the DNS server.</p>
<p><span id="more-245"></span></p>
<p>On the sendmail system, create a configuration containing the <em>dnsbl </em>feature. Identify the local DNS   blackhole list on the <em>dnsbl</em> command line. Here is an example:</p>
<pre>dnl Point dnsbl to our local DNS blackhole list

FEATURE(`dnsbl', `dnsbl.wrotethebook.com')</pre>
<p>Rebuild the <em>sendmail.cf</em> file, copy the new <em>sendmail.cf</em> file to <em>/etc/mail</em>, and restart sendmail.</p>
<p>Using a blackhole list service is simple but inflexible because   you can&#8217;t choose which sites are listed. This means that mail from a friendly   site might be blocked just because the administrator at that site misconfigured   relaying. For this reason, some organizations decide to build their own   DNS-based blackhole list. Creating your own blackhole server ensures that   connectivity to all of the sites you want to reach is under your direct control,   but it requires both sendmail and DNS expertise.</p>
<p>The DNS administrator uses a zone statement in the DNS   server&#8217;s <em>named.conf </em>file to load the blackhole database. Assuming that   the blacklisted hosts are defined in a zone file named <em>blacklisted.hosts</em>,   which provides the data for a domain named <em>dnsbl.wrotethebook.com</em>, the   following zone statement would be used:</p>
<pre>zone "dnsbl.wrotethebook.com" IN {

type master;

file "blacklisted.hosts";

allow-update { none; };

};</pre>
<p>Blackhole entries for addresses 10.0.187.215 and   192.168.0.3 defined in the <em>blacklisted.hosts</em> file would be the   following:</p>
<pre>215.187.0.10                 IN A 127.0.0.2

3.0.168.192                  IN A 127.0.0.2</pre>
<p>The newly created DNS domain is referenced as the source for   blackhole list data on the <em>dnsbl</em> feature command line in the Solution   section. Mail from any site listed in the <em>dnsbl.wrotethebook.com</em> domain   is rejected, as this attempt to send mail from 192.168.0.3 shows:</p>
<pre># <strong>telnet chef smtp</strong>

Trying 192.168.0.8...

Connected to 192.168.0.8.

Escape character is '^]'.

220 chef.wrotethebook.com ESMTP Sendmail 8.12.9/8.12.9; Fri, 22 Aug 2003 12:01:37 -  0400

<strong>helo rodent.wrotethebook.com</strong>

250 chef.wrotethebook.com Hello rodent.wrotethebook.com [192.168.0.3], pleased to   meet you

<strong>MAIL From:&lt;craig@rodent.wrotethebook.com&gt;</strong>

550 5.7.1 Rejected: 192.168.0.3 listed at dnsbl.wrotethebook.com

<strong>QUIT</strong>

221 2.0.0 chef.wrotethebook.com closing connection  Connection closed by foreign host.</pre>
<p>The connection address 192.168.0.3 is found in the <em>dnsbl.wrotethebook.com</em> domain, so our server rejects the mail and returns   the error message &#8220;550 5.7.1 Rejected: 192.168.0.3 listed at   dnsbl.wrotethebook.com.&#8221; This default error message can be changed with an   additional argument on the <em>dnsbl</em> feature command line. For example, the   command:</p>
<pre>FEATURE(`dnsbl', `dnsbl.wrotethebook.com', `"Mail rejected. "$&amp;{client_addr}" is a   suspected spam relay."')</pre>
<p>changes the error message to &#8220;Mail rejected. 192.168.0.3 is a   suspected spam relay.&#8221; However, the standard message works well and provides the   remote site with more information.</p>
<p>The small number of systems used in the blackhole list  could much more easily have been handled by the <em>access</em> database.   In most cases, using the <em>access</em> database to block unwanted mail   connections is much easier than creating your own blackhole list. Creating and   maintaining your own blackhole list is labor intensive. The systems that should   be added to and removed from the list are constantly changing. Additionally, a   great deal of information is needed to initially build a list. It is possible to   use a mail filtering tool, such as procmail, to   automatically collect suspected addresses directly from mail. However, it is   difficult to create a system that collects the right information and keeps it   up-to-date. Most administrators prefer to create their own blackhole list based   on the blackhole list provided by a blackhole list service. The services already   have large lists and they constantly maintain them. Most blackhole list services   provide some way to download the entire list. For example, the DSBL list can be   downloaded using rsync:</p>
<pre># rsync rsync.dsbl.org::dsbl/bind-list.dsbl.org.</pre>
<p>Periodically downloading a list and customizing it is one way   to create your own blackhole list. But even if you start with a preexisting   list, creating your own blackhole list is not a task that should be undertaken   lightly. Creating your own blackhole list is one of the most difficult   techniques for controlling unwanted junk email.</p>
<p>As usual, the choice between using a blackhole list service or   building your own blackhole list is a choice between simplicity and flexibility.   Most sites choose simplicity. If you don&#8217;t have the available staff necessary to   build and maintain your own blackhole list, stick with a standard blackhole list   service.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2009/02/12/building-your-own-dns-blackhole-list/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using a DNS Blackhole List Service</title>
		<link>http://www.xiitec.com/blog/2009/02/12/using-a-dns-blackhole-list-service/</link>
		<comments>http://www.xiitec.com/blog/2009/02/12/using-a-dns-blackhole-list-service/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 18:42:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sendmail]]></category>
		<category><![CDATA[blackhole]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=244</guid>
		<description><![CDATA[Add the dnsbl feature to the sendmail configuration.   Identify the specific blackhole list service you wish to use on the dnsbl command line. Here is an example:

dnl Use the DSBL blacklist service

FEATURE(`dnsbl', `list.dsbl.org')
Rebuild the sendmail.cf file, copy the new sendmail.cf file to /etc/mail, and restart sendmail.
The dnsbl feature adds the sendmail.cf code  [...]]]></description>
			<content:encoded><![CDATA[<p>Add the <em>dnsbl </em>feature to the sendmail configuration.   Identify the specific blackhole list service you wish to use on the <em>dnsbl</em> command line. Here is an example:</p>
<p><span id="more-244"></span></p>
<pre>dnl Use the DSBL blacklist service

FEATURE(`dnsbl', `list.dsbl.org')</pre>
<p>Rebuild the <em>sendmail.cf</em> file, copy the new <em>sendmail.cf</em> file to <em>/etc/mail</em>, and restart sendmail.</p>
<p>The <em>dnsbl</em> feature adds the <em>sendmail.cf</em> code   needed to enable a DNS blacklist service. The <em>dnsbl</em> feature uses a   K command to define the <em>dnsbl</em> database as a host type   database, which means lookups in <em>dnsbl</em> are really passed to DNS for   resolution.The <em>dnsbl</em> feature also   adds a few rules to the Basic_check_relay ruleset, which is called from   the check_relay ruleset. The added rules lookup the connection address   in the <em>dnsbl</em> database. If the connection address is found in the   database, mail from that address is rejected with an error message. If the   connection address is not found in the <em>dnsbl</em> database, the mail is passed   on for further processing. A sendmail -bt test shows the   impact of the added rewrite rules:</p>
<pre># <strong>sendmail -bt</strong>

ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)

Enter &lt;ruleset&gt; &lt;address&gt;

&gt; <strong>.D{client_addr}192.168.111.68</strong>

&gt; <strong>Basic_check_relay &lt;&gt;</strong>

Basic_check_rela   input: &lt; &gt;

Basic_check_rela returns: $# error $@ 5 . 7 . 1 $: "550 Rejected:

" 192 . 168 . 111 .  68 " listed at list.dsbl.org"

&gt; <strong>/quit</strong></pre>
<p>Because there is no active connection—this is just a test—the   first step is to statically define a connection address for the test. Next, the   Basic_check_relay ruleset is called and passed to an empty workspace.   The workspace passed to the ruleset in this test is unimportant because the   first rule added to the ruleset by the <em>dnsbl</em> feature unconditionally   replaces the workspace with the value found in ${client_addr}.   Therefore, the value looked up in the <em>dnsbl</em> database is the connection   address stored in the ${client_addr} macro. In this test, the address   192.168.111.68 is found in the blackhole list maintained at <em>list.dsbl.org</em>, so mail from that address is rejected. The mail is   rejected with the error message:</p>
<pre>550 Rejected: 192.168.111.68 listed at list.dsbl.org</pre>
<p>The error message displays the address that was rejected and   the service that recommended the rejection. This information is important. The   administrators at 192.168.111.68 might need to contact the blackhole   service to find out why their system is blacklisted and what they can do to get   it removed from the blackhole list. Often, a system is blacklisted because of a   configuration error that creates an open relay. As soon as the error is fixed,   the administrator wants to get the system removed from the blackhole list.   Knowing which services have blacklisted the system tells the administrator which   services must be contacted to get full mail service restored.</p>
<p>This configuration uses the blackhole server at <em>list.dsbl.org</em> because that is the service specified with the <em>dnsbl</em> feature command, which is just an example; it is not a   recommendation for the <em>list.dsbl.org</em> service. There are many blackhole   services available. Go to each service&#8217;s web site and evaluate their policy for listing   hosts in the database. Select the service whose policy most closely matches the   policy you want to enforce on your server.</p>
<p>When no service is specified on the <em>dnsbl</em> feature   command line, sendmail defaults to using <em>blackholes.mail-abuse.org</em>, which   is the same service that was used by the deprecated sendmail <em>rbl</em> feature.</p>
<p>The <em>enhdnsbl</em> feature could be used as an alternative to <em>dnsbl</em>. However, the <em>enhdnsbl</em> feature provides no   real advantage in this particular case.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2009/02/12/using-a-dns-blackhole-list-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Registering DNS Records or Flushing the DNS Cache</title>
		<link>http://www.xiitec.com/blog/2008/02/14/registering-dns-records-or-flushing-the-dns-cache/</link>
		<comments>http://www.xiitec.com/blog/2008/02/14/registering-dns-records-or-flushing-the-dns-cache/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 23:18:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[flush]]></category>
		<category><![CDATA[Register]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=130</guid>
		<description><![CDATA[Using a command-line interface
The following command displays the contents of the local DNS cache:
&#62; ipconfig /displaydns

And this clears that cache:
&#62; ipconfig /flushdns
The following command causes the local host to reregister its  DNS records via dynamic DNS:
&#62; ipconfig /registerdns
Using VBScript
' This code flushes the local DNS cache.  There are no scripting

' interfaces designed to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Using a command-line interface</strong></p>
<p>The following command displays the contents of the local DNS cache:</p>
<pre>&gt; ipconfig /displaydns</pre>
<p><span id="more-130"></span></p>
<p>And this clears that cache:</p>
<pre>&gt; ipconfig /flushdns</pre>
<p>The following command causes the local host to reregister its  DNS records via dynamic DNS:</p>
<pre>&gt; ipconfig /registerdns</pre>
<p><strong>Using VBScript</strong></p>
<pre>' This code flushes the local DNS cache.  There are no scripting

' interfaces designed to do this so I have to shell out and run

' the ipconfig /flushdns command.

strCommand = "ipconfig /flushdns"

set objWshShell = WScript.CreateObject("WScript.Shell")

intRC = objWshShell.Run(strCommand, 0, TRUE)

if intRC &lt;&gt; 0 then

   WScript.Echo "Error returned from running the command: " &amp; intRC

else

   WScript.Echo "Command executed successfully"

end if' This code registers DNS records for the local host.  There are

' no scripting interfaces designed to do this so I have to shell

' out and run the ipconfig /registerhdns command.

strCommand = "ipconfig /registerdns"

set objWshShell = WScript.CreateObject("WScript.Shell")

intRC = objWshShell.Run(strCommand, 0, TRUE)

if intRC &lt;&gt; 0 then

   WScript.Echo "Error returned from running the command: " &amp; intRC

else

   WScript.Echo "Command executed successfully"

end if</pre>
<p>The Windows operating system maintains a name resolution cache  of DNS records that the system has queried. This cache is maintained in memory  and speeds up future requests for the same record. Each record has an associated  time-to-live value. This setting informs clients of the maximum amount of time  to cache that particular record. After the time-to-live period expires, Windows  removes the record from its cache.</p>
<p>The Windows name resolution cache is maintained by the DNS  Cache (DnsCache) service. You can prevent records from being cached by stopping  this service (and disabling it if you never want records to be cached again). If  you are getting strange results when querying DNS, you may want to view the  local DNS cache to see if you are accessing locally cached records instead of  what is current on the DNS Server.</p>
<p>The <tt>/registerdns</tt> option of <tt>ipconfig</tt> attempts  to dynamically reregister DNS records for all IP addresses configured on the  system. The DHCP Client (Dhcp) service does the DNS reregistration, so if that  service is disabled, the <tt>/registerdns</tt> option won&#8217;t work (even if all  addresses are statically configured).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/14/registering-dns-records-or-flushing-the-dns-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring an IP Address</title>
		<link>http://www.xiitec.com/blog/2008/02/14/configuring-an-ip-address/</link>
		<comments>http://www.xiitec.com/blog/2008/02/14/configuring-an-ip-address/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 22:54:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[address]]></category>
		<category><![CDATA[configure]]></category>
		<category><![CDATA[DHCP]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[IP]]></category>

		<guid isPermaLink="false">http://www.xiitec.com/blog/?p=127</guid>
		<description><![CDATA[Using a graphical user interface
&#160;

From the Control Panel, open the Network Connections applet.
Double-click the connection you want to configure.
Click the Properties  button.
Double-click Internet Protocol  (TCP/IP).
To enable DHCP, select Obtain an IP  address automatically. To use a static address, select Use the following IP address. Then configure the IP  address, subnet mask, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Using a graphical user interface</strong></p>
<p style="font-weight: bold">&nbsp;</p>
<ol>
<li>From the Control Panel, open the <span class="docEmphBold">Network Connections</span> applet.</li>
<li>Double-click the connection you want to configure.</li>
<li>Click the <span class="docEmphBold">Properties</span>  button.</li>
<li>Double-click <span class="docEmphBold">Internet Protocol  (TCP/IP)</span>.</li>
<li>To enable DHCP, select <span class="docEmphBold">Obtain an IP  address automatically</span>. To use a static address, select <span class="docEmphBold">Use the following IP address</span>. Then configure the IP  address, subnet mask, and default gateway.</li>
<li>Click <span class="docEmphBold">OK</span> until all windows are  closed.</li>
</ol>
<p><span id="more-127"></span><br />
<strong>Using a command-line interface</strong></p>
<p>The following command configures DHCP for a connection:</p>
<pre>&gt; netsh int ip set address name="<tt><em>&lt;ConnectionName&gt;</em></tt>" source=dhcp</pre>
<p>Here is an example for configuring the connection named &#8220;Local  Area Connection&#8221; to use DHCP:</p>
<pre>&gt; netsh int ip set address name="Local Area Connection" source=dhcp</pre>
<p>This configures a connection with a static IP and default  gateway:</p>
<pre>&gt; netsh int ip set address name="<tt><em>&lt;ConnectionName&gt;</em></tt>" source=static <tt><em>&lt;IP&gt;</em></tt> <tt><em>&lt;Mask&gt;</em></tt> <tt><em>&lt;GateWayIP&gt;</em></tt> <tt><em>&lt;Metric&gt;</em></tt></pre>
<p>This example configures a static IP address for &#8220;Local Area  Connection&#8221;:</p>
<pre>&gt; netsh int ip set address name="Local Area Connection" source=static 10.3.53.3
255.255.255.0 10.3.53.1 1</pre>
<p><strong>Using VBScript</strong></p>
<pre>' This code enables DHCP for the specified connection.
' ------ SCRIPT CONFIGURATION ------
strComputer = "."
strConnection = "Local Area Connection"
' ------ END CONFIGURATION ---------
set objWMI = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2")
set colNA = objWMI.ExecQuery("select * " &amp; _
                             " from Win32_NetworkAdapter " &amp; _
                             " where NetConnectionID = '" &amp; strConnection &amp; "'" )
for each objNA in colNA
   set colNAConfig = objWMI.ExecQuery _
      ("ASSOCIATORS OF {Win32_NetworkAdapter.DeviceID='" &amp; _
        objNA.DeviceID &amp; "'} " &amp; _
      " WHERE resultClass = win32_NetworkAdapterConfiguration ")
   for each objNAConfig in colNAConfig
      if objNAConfig.DHCPEnabled = True then
         WScript.Echo "DHCP already enabled for " &amp; strConnection
      else
         intRC = objNAConfig.EnableDHCP( )
         if intRC = 0 then
            WScript.Echo "DHCP Enabled for " &amp; strConnection
         elseif intRC = 1 then
            WScript.Echo "You must reboot to start using DHCP for " &amp; _
                         strConnection
         else
            WScript.Echo "There was an error enabling DHCP for " &amp; _
                         strconnection &amp; ": " &amp; intRC
         end if
      end if
   next
next

' This code configures an IP address, subnet mask, and default gateway
' for the specified connection.
' ------ SCRIPT CONFIGURATION ------
strComputer = "."
strConnection = "Local Area Connection"
strIP = Array("1.22.2.2")
strMask = Array("255.255.255.0")
strGatewayIP = Array("1.2.3.3")
' ------ END CONFIGURATION ---------
set objWMI = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2")
set colNA = objWMI.ExecQuery("select * " &amp; _
                            " from Win32_NetworkAdapter " &amp; _
                            " where NetConnectionID = '" &amp; strConnection &amp; "'" )
for each objNA in colNA
   set colNAConfig = objWMI.ExecQuery _
      ("ASSOCIATORS OF {Win32_NetworkAdapter.DeviceID='" &amp; _
        objNA.DeviceID &amp; "'} " &amp; _
      " WHERE resultClass = win32_NetworkAdapterConfiguration ")
   for each objNAConfig in colNAConfig
      intRC = objNAConfig.EnableStatic(strIP,strMask)
      intRC2 = objNAConfig.SetGateways(strGatewayIP)
      if intRC = 0 and intRC2 = 0 then
         WScript.Echo "IP address configured for " &amp; strConnection
      elseif intRC = 1 or intRC2 = 1 then
         WScript.Echo "You must reboot for the changes to take effect for " &amp; _
                      strConnection
      else
         WScript.Echo "There was an error configuring IP for " &amp; _
                      strconnection &amp; ": " &amp; intRC &amp; " and " &amp; intRC2
      end if
   next
next</pre>
<p>If you use static IP addresses, any time you build a new  server, you have to configure an IP address on that server. However, there is no  reason why you can&#8217;t automate the process using either the <em>netsh</em> command shown in the command-line  solution or WMI. You still have to find an available IP address, which may not  be easy to automate depending on your environment, but at least you can  provision the IP address in an automated fashion.</p>
<p>This leads to a discussion of using DHCP on servers. You&#8217;ll  find some people dead set against it and others who wouldn&#8217;t do it any other  way. Since network adapters are by default configured to use DHCP, you can  remove the step of configuring network settings, such as IP address, DNS  servers, etc., on your servers by using DHCP. After the server completes the  build process and reboots, it will automatically request an IP address. But as  you probably know, DHCP addresses aren&#8217;t set in stone. The next time the server  reboots, it might obtain a different address. And since you more than likely  want to add an A record (and possibly a PTR record) in DNS for this server, if  it got a new address, those records would no longer be valid.</p>
<p>There are two ways to work around this. First, you can  configure a reservation on the DHCP server for a specific IP address. You only  need to retrieve the MAC address of the server&#8217;s network adapter order to  configure a reservation (you can get this via the <tt>ipconfig</tt>  <tt>/all</tt> command). With this  configuration, the server will always receive the same IP address even though it  is getting it from DHCP. The benefit of this is that you don&#8217;t have to manually  configure the other settings such as DNS and WINS servers directly on the  server. The potential drawback is that if you have to change network adapters  for any reason, the reservation would also have to be updated.</p>
<p>The second option is to use dynamic DNS to have the server  automatically update DNS based on its current IP address. In fact, you could  have the sever itself send the dynamic updates or use DHCP to do that. That way, even if the server gets a new IP address after every  reboot, DNS will be updated automatically. The benefit to this is that it is the  most automated solution. There is very little configuration you have to do on a  per-server basis (and it is therefore attractive for large environments). The  downside is that DNS could have outdated information for a period of time until  the server dynamically updates its new information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xiitec.com/blog/2008/02/14/configuring-an-ip-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>

