<?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>Local Loop &#187; python</title>
	<atom:link href="http://localloop.co.za/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://localloop.co.za</link>
	<description>Internet and Networking in South Africa</description>
	<lastBuildDate>Sat, 09 Jul 2011 00:48:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>IP sub-netting for fun and profit</title>
		<link>http://localloop.co.za/2009/10/ip-sub-netting-for-fun-and-profit/</link>
		<comments>http://localloop.co.za/2009/10/ip-sub-netting-for-fun-and-profit/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 08:59:48 +0000</pubDate>
		<dc:creator>Simeon Miteff</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[bgp]]></category>
		<category><![CDATA[ddos]]></category>
		<category><![CDATA[prefix hijack]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[subnetting]]></category>

		<guid isPermaLink="false">http://localloop.co.za/?p=355</guid>
		<description><![CDATA[IP sub-netting is one of the first things one learns about network administration. You have a /22, you want /24&#8242;s, 2 bits give you 4 sub-nets. Or you want one /24, so you break the /22 into two /24&#8242;s and a /23. Not rocket science. It&#8217;s the kind of thing you can do in your [...]]]></description>
			<content:encoded><![CDATA[<p>IP sub-netting is one of the first things one learns about network administration.</p>
<p>You have a /22, you want /24&#8242;s, 2 bits give you 4 sub-nets. Or you want one /24, so you break the /22 into two /24&#8242;s and a /23. Not rocket science. It&#8217;s the kind of thing you can do in your head and keep track of in a spreadsheet or a text file if you don&#8217;t have too many networks.</p>
<p>When you&#8217;re planning an IP addressing scheme, you probably have the luxury of time, to think about it. But what if you need to do this in a crisis situation? Fortunately it has never happened to me, but I can think of scenarios where you need to do this very quickly:</p>
<p>Apparently, if you use BGP to advertise a network to the Internet and specific hosts within that network become the target of a <a href="http://en.wikipedia.org/wiki/Denial-of-service_attack#Distributed_attack">DDoS attack</a>, one way to mitigate the attack could be to stop advertising the /24 sub-nets being attacked. Although this means the attacker still succeeds in taking down his intended targets (because he made you take them down), at least you can remove the attack traffic from your link, and the rest of your network can remain available.</p>
<p>Another scenario might be someone hijacking part of your network by advertising a more specific route than you are (either intentionally, or due to a BGP filtering misconfiguration). This <a href="http://ripe.net/news/study-youtube-hijacking.html">happened to youtube</a> last year.</p>
<p>Either way, you&#8217;ll need to split the network into at least two (in the case of a /23) sub-nets to get a /24, which is generally the longest prefix accepted on the Internet. In the former case, you want to withdraw the more specific network, and in the latter you want to advertise it.</p>
<p>To this end, I have written a script that accepts a list of networks (in CIDR format, one per line) from STDIN, and the desired sub-net as the first command line argument. It loops through the input subnets, looking  for the one that overlaps with the desired prefix. If a network doesn&#8217;t match, the script just prints it out untouched, if it does, then the script will de-aggregate that network into the minimum number of sub-nets in order to get the desired sub-net as one of the outputs. It prints the surrounding pieces, and unless you specify &#8220;-exclude&#8221; as the second argument, the desired sub-net itself is also added to the output:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python</span>
<span style="color: #808080; font-style: italic;"># deaggregate.py - deaggregate a network for a specific subnet, yielding the minimum number of subnets</span>
<span style="color: #808080; font-style: italic;"># Add -exclude to only output the surrounding subnets. Subnet is read from stdin, all non matching subnets</span>
<span style="color: #808080; font-style: italic;"># are output untouched. Use as a filter, rinse, repeat.</span>
<span style="color: #808080; font-style: italic;"># Simeon Miteff &lt;simeon@localloop.co.za&gt;</span>
<span style="color: #ff7700;font-weight:bold;">from</span> IPy <span style="color: #ff7700;font-weight:bold;">import</span> IP
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> split<span style="color: black;">&#40;</span>ip,sub,exclude<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> ip==sub:
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> exclude:
            <span style="color: #ff7700;font-weight:bold;">print</span> ip
    <span style="color: #ff7700;font-weight:bold;">else</span>:
        a = IP<span style="color: black;">&#40;</span><span style="color: #008000;">str</span><span style="color: black;">&#40;</span>ip.<span style="color: black;">net</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>+<span style="color: #483d8b;">'/'</span>+<span style="color: #008000;">str</span><span style="color: black;">&#40;</span>ip.<span style="color: black;">prefixlen</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>+<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        b = IP<span style="color: black;">&#40;</span><span style="color: #008000;">str</span><span style="color: black;">&#40;</span>IP<span style="color: black;">&#40;</span>ip.<span style="color: black;">net</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>|<span style="color: #ff4500;">2</span><span style="color: #66cc66;">**</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">32</span>-<span style="color: black;">&#40;</span>ip.<span style="color: black;">prefixlen</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>+<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>+<span style="color: #483d8b;">'/'</span>+<span style="color: #008000;">str</span><span style="color: black;">&#40;</span>ip.<span style="color: black;">prefixlen</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>+<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> a.<span style="color: black;">overlaps</span><span style="color: black;">&#40;</span>sub<span style="color: black;">&#41;</span>:
            <span style="color: #ff7700;font-weight:bold;">print</span> b
            split<span style="color: black;">&#40;</span>a,sub,exclude<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">elif</span> b.<span style="color: black;">overlaps</span><span style="color: black;">&#40;</span>sub<span style="color: black;">&#41;</span>:
            <span style="color: #ff7700;font-weight:bold;">print</span> a
            split<span style="color: black;">&#40;</span>b,sub,exclude<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> __name__==<span style="color: #483d8b;">&quot;__main__&quot;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">&lt;</span><span style="color: #ff4500;">2</span>:
        <span style="color: #dc143c;">sys</span>.<span style="color: black;">stderr</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Usage: %s CIDR_prefix [-exclude]<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span> 
        <span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
&nbsp;
    sub = IP<span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
&nbsp;
    exclude = <span style="color: #008000;">False</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#41;</span>==<span style="color: #ff4500;">3</span>:
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span>==<span style="color: #483d8b;">'-exclude'</span>:
            exclude = <span style="color: #008000;">True</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">for</span> line <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">stdin</span>:
        pre = IP<span style="color: black;">&#40;</span>line.<span style="color: black;">strip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> pre.<span style="color: black;">overlaps</span><span style="color: black;">&#40;</span>sub<span style="color: black;">&#41;</span>:
            <span style="color: #ff7700;font-weight:bold;">print</span> line.<span style="color: black;">strip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">else</span>:
            split<span style="color: black;">&#40;</span>pre,sub,exclude<span style="color: black;">&#41;</span></pre></div></div>

<p>An example run:</p>
<pre>simeon@capybara:~/personal$ cat routes.txt
10.0.0.0/10
192.168.0.0/16
simeon@capybara:~/personal$ python deaggregate.py 10.0.100.0/24 < routes.txt
10.32.0.0/11
10.16.0.0/12
10.8.0.0/13
10.4.0.0/14
10.2.0.0/15
10.1.0.0/16
10.0.128.0/17
10.0.0.0/18
10.0.64.0/19
10.0.112.0/20
10.0.104.0/21
10.0.96.0/22
10.0.102.0/23
10.0.101.0/24
10.0.100.0/24
192.168.0.0/16
simeon@capybara:~/personal$</pre>
<p>It requires the IPy module (<code>apt-get install python-ipy</code>). To handle multiple desired sub-nets, run the script again for each subsequent sub-net, using the output of the previous run as the input. Note that your (and your upstream's) filters might need to be updated (unless your original prefix is allowed with something like <code>"le 24"</code>).</p>
<p>I've added this to the <a href="http://localloop.co.za/code">code page</a>. Thanks for listening :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://localloop.co.za/2009/10/ip-sub-netting-for-fun-and-profit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The humble ZA Internet Map</title>
		<link>http://localloop.co.za/2009/09/the-humble-za-internet-map/</link>
		<comments>http://localloop.co.za/2009/09/the-humble-za-internet-map/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 21:15:04 +0000</pubDate>
		<dc:creator>Simeon Miteff</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[bgp]]></category>
		<category><![CDATA[dia]]></category>
		<category><![CDATA[graphviz]]></category>
		<category><![CDATA[ispmap]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[za internet map]]></category>

		<guid isPermaLink="false">http://localloop.co.za/?p=303</guid>
		<description><![CDATA[I&#8217;ve been playing with BGP-based maps showing links between South African autonomous systems, on-and-off, for a long time. I always got stuck at the graph layout step and was never able to trick GraphViz into doing exactly what I wanted. When I re-visited this project one evening this week, I decided to generate a Dia [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing with BGP-based maps showing links between South African autonomous systems, on-and-off, for a long time. I always got stuck at the graph layout step and was never able to trick GraphViz into doing exactly what I wanted. When I re-visited this project one evening this week, I decided to generate a Dia XML document instead of a dot(1) file, and do the layout by hand. The result is my first map:<br />
<div id="attachment_299" class="wp-caption aligncenter" style="width: 613px"><a href="http://localloop.co.za/wp-content/uploads/2009/09/za_map_2009091.png"><img src="http://localloop.co.za/wp-content/uploads/2009/09/za_map_200909_small1.png" alt="ZA Internet Map (click for full size image)" title="za_map_200909_small1" width="603" height="426" class="size-full wp-image-299" /></a><p class="wp-caption-text">ZA Internet Map (click for full size image)</p></div><br />
I plan to improve and update this map on a regular basis, so it&#8217;s earned itself a <a href="/internet-map">dedicated page</a>. Some quick technical notes about what you&#8217;re seeing:</p>
<ul>
<li>Only local autonomous systems are included. I&#8217;ll probably include the first international upstreams, in the next version.</li>
<li>Only the inbound path (international transit, probably) as seen from RouteViews OIX is shown. This means peering links are not indicated. That might also change in the next version.</li>
<li>This is not an ISP map, like <a href="http://www.ispmap.org.za">Greg Massel&#8217;s</a>, because it includes all autonomous systems, including non-ISP&#8217;s such as customers/end-users running BGP. I&#8217;m toying with the idea of colour-coding different types of ASes.</li>
<li>There are likely to be errors. If you spot them, please <a href="mailto:simeon@localloop.co.za">let me know</a> so that I can correct my scripts.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://localloop.co.za/2009/09/the-humble-za-internet-map/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Reading MikroTik&#8217;s winbox addresses.wbx file format</title>
		<link>http://localloop.co.za/2008/10/reading-mikrotiks-winbox-addresseswbx-file-format/</link>
		<comments>http://localloop.co.za/2008/10/reading-mikrotiks-winbox-addresseswbx-file-format/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 10:34:55 +0000</pubDate>
		<dc:creator>Simeon Miteff</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[mikrotik]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[routeros]]></category>
		<category><![CDATA[winbox]]></category>

		<guid isPermaLink="false">http://localloop.co.za/?p=113</guid>
		<description><![CDATA[MikroTik, a Latvian network equipment vendor makes a Linux-based router operating system called RouterOS. It has become a popular software platform for wireless networking, and the WISP industry. While it has it&#8217;s fair share of bugs (OSPF instabilities in 2.9.x for example), I quite enjoy working with RouterOS. I recently noticed that version 3 sports [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mikrotik.com/">MikroTik</a>, a Latvian network equipment vendor makes a Linux-based router operating system called RouterOS. It has become a popular software platform for wireless networking, and the WISP industry.</p>
<p>While it has it&#8217;s fair share of bugs (OSPF instabilities in 2.9.x for example), I quite enjoy working with RouterOS. I recently noticed that version 3 sports some &#8220;grown up&#8221; router features, like MPLS support, as well as some innovative stuff like <a href="http://www.xen.org/">Xen</a> integration.</p>
<p>Apart from a good CLI interface, RouterOS also has a Windows client application for configuration and monitoring called winbox. A convenient feature of winbox is that you can save device profiles, and optionally store their login credentials. If you want to move these saved profiles to another machine, you can use the <code>Tools->Export/Import</code> function, that respectively writes and reads a binary file called <code>addresses.wbx</code>.</p>
<p>If you&#8217;ve forgotten the login password for one of your RouterOS devices, but you chose to have winbox store it, you can use <code>strings(1)</code> to dump the contents of <code>addresses.wbx</code> to retrieve it.</p>
<p>Last week I wrote a little python script called <code>wbx.py</code> that reads this binary format and presents the output in a tabular format that is somewhat friendlier than what <code>strings(1)</code> (or <code>notepad.exe</code> for the unfortunate) would produce. Please be warned though, it&#8217;s not well tested, so your mileage may vary.</p>
<p>I&#8217;ve added a <a href="http://localloop.co.za/code">code</a> page, where I intend to begin collecting any executable bits that I happen to blog about. You can find wbx.py there.</p>
]]></content:encoded>
			<wfw:commentRss>http://localloop.co.za/2008/10/reading-mikrotiks-winbox-addresseswbx-file-format/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Making BIND zone files readable</title>
		<link>http://localloop.co.za/2008/09/making-bind-zone-files-readable/</link>
		<comments>http://localloop.co.za/2008/09/making-bind-zone-files-readable/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 09:11:50 +0000</pubDate>
		<dc:creator>Simeon Miteff</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://localloop.co.za/?p=76</guid>
		<description><![CDATA[The zone configuration format for BIND has a number of short-cuts that make writing DNS zone files easy, but also make them hard to read. Here is an example: $TTL 3D @ SOA server1.example.com. hostmaster.example.com. (1 8H 2H 4W 1D) NS server1 NS server2 MX 10 server1 MX 20 server2 server1 A 127.0.0.1 server2 A [...]]]></description>
			<content:encoded><![CDATA[<p>The zone configuration format for <a href="http://www.isc.org/sw/bind/">BIND</a> has a number of short-cuts that make writing DNS zone files easy, but also make them hard to read. Here is an example:<br />
<code><br />
$TTL 3D<br />
@   SOA server1.example.com. hostmaster.example.com. (1 8H 2H 4W 1D)<br />
    NS  server1<br />
    NS  server2<br />
    MX 10   server1<br />
    MX 20   server2<br />
server1  A   127.0.0.1<br />
server2  A   127.0.0.2<br />
www     CNAME   server1<br />
</code></p>
<p><a href="http://www.python.org">Python</a> to the rescue. The <a href="http://www.dnspython.com">dnspython</a> module has support for parsing BIND zones, and rendering them without the shortcuts:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python</span>
<span style="color: #808080; font-style: italic;"># bindnorm.py - &quot;normalise&quot; a bind zone file by expanding relative names.</span>
<span style="color: #808080; font-style: italic;"># Simeon Miteff &lt;simeon@localloop.co.za&gt;</span>
<span style="color: #808080; font-style: italic;"># Tue Sep 23 10:03:35 SAST 2008</span>
<span style="color: #ff7700;font-weight:bold;">import</span> dns.<span style="color: black;">zone</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">&lt;</span><span style="color: #ff4500;">2</span>:
	<span style="color: #dc143c;">sys</span>.<span style="color: black;">stderr</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Usage: %s [zone fqdn]<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
	<span style="color: #dc143c;">sys</span>.<span style="color: black;">stderr</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Example: %s example.com &lt; db.example.com &gt; norm.db.example.com<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
	<span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
&nbsp;
zone = dns.<span style="color: black;">zone</span>.<span style="color: black;">from_text</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">stdin</span>.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>, <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span>, relativize=<span style="color: #008000;">False</span>, check_origin=<span style="color: #008000;">False</span><span style="color: black;">&#41;</span>
zone.<span style="color: black;">to_file</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">stdout</span>, relativize=<span style="color: #008000;">False</span><span style="color: black;">&#41;</span></pre></div></div>

<p>To use it, you&#8217;ll need to install <code>dnspython</code> first. Fortunately, on Debian or Ubuntu, it&#8217;s just an <code>apt-get install python-dnspython</code> away. Running this little script with the example zone above as input yields:<br />
<code><br />
example.com. 259200 IN SOA server1.example.com. hostmaster.example.com. 1 28800 7200 2419200 86400<br />
example.com. 259200 IN NS server1.example.com.<br />
example.com. 259200 IN NS server2.example.com.<br />
example.com. 259200 IN MX 10 server1.example.com.<br />
example.com. 259200 IN MX 20 server2.example.com.<br />
server1.example.com. 259200 IN A 127.0.0.1<br />
server2.example.com. 259200 IN A 127.0.0.2<br />
www.example.com. 259200 IN CNAME server1.example.com.<br />
</code></p>
<p>This format is less canonical, but at least each line is context-free. Now you can proceed to <code>grep</code> the output to your heart&#8217;s desire :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://localloop.co.za/2008/09/making-bind-zone-files-readable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

