<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: DNSCMD Kung Fu</title>
	<atom:link href="http://www.edgeblog.net/2008/dnscmd-kung-fu/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.edgeblog.net/2008/dnscmd-kung-fu/</link>
	<description>Notes from the edge</description>
	<lastBuildDate>Mon, 30 Jan 2012 19:27:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Dynamic DNS update testingLife, network and security &#124; Life, network and security</title>
		<link>http://www.edgeblog.net/2008/dnscmd-kung-fu/comment-page-1/#comment-150919</link>
		<dc:creator>Dynamic DNS update testingLife, network and security &#124; Life, network and security</dc:creator>
		<pubDate>Wed, 01 Jun 2011 10:32:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.edgeblog.net/?p=113#comment-150919</guid>
		<description>[...] http://www.edgeblog.net/2008/dnscmd-kung-fu/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://www.edgeblog.net/2008/dnscmd-kung-fu/" rel="nofollow">http://www.edgeblog.net/2008/dnscmd-kung-fu/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bill</title>
		<link>http://www.edgeblog.net/2008/dnscmd-kung-fu/comment-page-1/#comment-133219</link>
		<dc:creator>bill</dc:creator>
		<pubDate>Fri, 04 Jun 2010 14:36:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.edgeblog.net/?p=113#comment-133219</guid>
		<description>Bill,

RecordAdd should ignore duplicates, but will add a record if some parameter is different. You can have 2 different A records for the same host with different IP addresses and use DNS round robin for poor man&#039;s load balancing. 

To capture the output, like most windows scripts, you can just pipe it into a file. Example:

dnscmd /enumzones &gt; zones.txt
for /f %%a in (zones.txt) do dnscmd /enumrecords %%a @ &gt; %%a.txt

There I am listing all the zones on my server and putting it into zones.txt. I am then using a FOR command to parse that file to be used by the /enumrecords command. I send the output for each zone into a file %zonename%.txt.

In your case for deleting records, you could then parse the approprate zone records. Just do an enumrecords on the zone, pipe it to a file, and then parse that file into variables. After that, you issue 2 record delete commands. The syntax from M$ is:

dnscmd  ServerName  /recorddelete  ZoneName  NodeName  RRType  RRData[/f]

You&#039;d need 1 line for the A record and one for the PTR record. This may seem like a lot of work, but write your script once and you&#039;ll never have to think about it again.

When using a FOR script, you can parse a multi-column text file with the value of each column being a seperate variable. You use the /delims switch to specify how the columns are seperated and the /tokens switch to specify which tokens you want. You can get the full syntax here:
http://technet.microsoft.com/en-us/library/cc754900%28WS.10%29.aspx

I hope this helps.

-Bill</description>
		<content:encoded><![CDATA[<p>Bill,</p>
<p>RecordAdd should ignore duplicates, but will add a record if some parameter is different. You can have 2 different A records for the same host with different IP addresses and use DNS round robin for poor man&#8217;s load balancing. </p>
<p>To capture the output, like most windows scripts, you can just pipe it into a file. Example:</p>
<p>dnscmd /enumzones > zones.txt<br />
for /f %%a in (zones.txt) do dnscmd /enumrecords %%a @ > %%a.txt</p>
<p>There I am listing all the zones on my server and putting it into zones.txt. I am then using a FOR command to parse that file to be used by the /enumrecords command. I send the output for each zone into a file %zonename%.txt.</p>
<p>In your case for deleting records, you could then parse the approprate zone records. Just do an enumrecords on the zone, pipe it to a file, and then parse that file into variables. After that, you issue 2 record delete commands. The syntax from M$ is:</p>
<p>dnscmd  ServerName  /recorddelete  ZoneName  NodeName  RRType  RRData[/f]</p>
<p>You&#8217;d need 1 line for the A record and one for the PTR record. This may seem like a lot of work, but write your script once and you&#8217;ll never have to think about it again.</p>
<p>When using a FOR script, you can parse a multi-column text file with the value of each column being a seperate variable. You use the /delims switch to specify how the columns are seperated and the /tokens switch to specify which tokens you want. You can get the full syntax here:<br />
<a href="http://technet.microsoft.com/en-us/library/cc754900%28WS.10%29.aspx" rel="nofollow">http://technet.microsoft.com/en-us/library/cc754900%28WS.10%29.aspx</a></p>
<p>I hope this helps.</p>
<p>-Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://www.edgeblog.net/2008/dnscmd-kung-fu/comment-page-1/#comment-133218</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Fri, 04 Jun 2010 14:11:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.edgeblog.net/?p=113#comment-133218</guid>
		<description>So what if the record already exists?  How does /RecordAdd behave?  Does it modify the current value of the record?  Or fail?    

How can I capture the output of one dnscmd to use as input for another?  What if I want to delete records?  To delete the PTR record, I&#039;d need to query for the value of the A record.  Then issue another command to delete the PTR record from the appropriate backup zone?  Then delete the A record.  Examples?</description>
		<content:encoded><![CDATA[<p>So what if the record already exists?  How does /RecordAdd behave?  Does it modify the current value of the record?  Or fail?    </p>
<p>How can I capture the output of one dnscmd to use as input for another?  What if I want to delete records?  To delete the PTR record, I&#8217;d need to query for the value of the A record.  Then issue another command to delete the PTR record from the appropriate backup zone?  Then delete the A record.  Examples?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Russell Jackson</title>
		<link>http://www.edgeblog.net/2008/dnscmd-kung-fu/comment-page-1/#comment-90170</link>
		<dc:creator>Russell Jackson</dc:creator>
		<pubDate>Tue, 23 Dec 2008 00:02:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.edgeblog.net/?p=113#comment-90170</guid>
		<description>You do know this could easily be done with BIND and nsupdate --assuming all
your zones are dynamic... right? In fact I could easily write a far more
readable and maintainable python script that does both the RR and zone creation
with actual error handling and everything. It would be reusable so I wouldn&#039;t
have to rely on error prone obfuscated one liners to boot.

We also store our DNS records in a version control repository where all changes
are audited, tested, and tagged before being pushed out to production. This is
real change _control_. What you&#039;re talking about is change monitoring. You
don&#039;t know about changes until after they wreaked havoc without the benefit of
knowing who did it.

The DNS records are stored in plain text in the VCS with a custom grammar that
keeps the records normalized. We define the hostname -&gt; IP address pairing once
with additional meta-data that identifies what zones the forward and reverse
belong to as well as if it should create static DHCP host entries. Using this
we can generate the zone databases on the fly with triggers from a
configuration management system that detects commits to the repository. The
configuration management system also guarantees --within reason-- that what is
in the repository is what is on the production boxes. If we want another DNS
server, we setup a minimally configured box, point the CMS at it, and ten
minutes later, it&#039;s serving up zones or anything else we need to have it doing.

I can command the entire thing --without ever touching the production boxes by
hand-- with nothing but a text editor, programming environment of choice and a
git/svn client. In fact, with TortoiseSVN, we even have our first-tier user
support staff making changes to the repository. Even if they screw it up, the
changes never make it to production.

You keep talking about the right tool for the job, but if you&#039;re maintaining a
large BIND installation using pico, ssh and for-loops, you&#039;re not following
your own advice. No wonder you like AD.

Frankly, I can&#039;t imagine a scenario where UNIX doesn&#039;t have the right _set_
--not necessarily a single uber one-- of tools for any particular job. The
right-tool-for-the-job mantra is usually just personal bias thinly veiled as
pragmatism. If you like MS junk, fine; keep using it. Your experience is still
only anecdotal.</description>
		<content:encoded><![CDATA[<p>You do know this could easily be done with BIND and nsupdate &#8211;assuming all<br />
your zones are dynamic&#8230; right? In fact I could easily write a far more<br />
readable and maintainable python script that does both the RR and zone creation<br />
with actual error handling and everything. It would be reusable so I wouldn&#8217;t<br />
have to rely on error prone obfuscated one liners to boot.</p>
<p>We also store our DNS records in a version control repository where all changes<br />
are audited, tested, and tagged before being pushed out to production. This is<br />
real change _control_. What you&#8217;re talking about is change monitoring. You<br />
don&#8217;t know about changes until after they wreaked havoc without the benefit of<br />
knowing who did it.</p>
<p>The DNS records are stored in plain text in the VCS with a custom grammar that<br />
keeps the records normalized. We define the hostname -&gt; IP address pairing once<br />
with additional meta-data that identifies what zones the forward and reverse<br />
belong to as well as if it should create static DHCP host entries. Using this<br />
we can generate the zone databases on the fly with triggers from a<br />
configuration management system that detects commits to the repository. The<br />
configuration management system also guarantees &#8211;within reason&#8211; that what is<br />
in the repository is what is on the production boxes. If we want another DNS<br />
server, we setup a minimally configured box, point the CMS at it, and ten<br />
minutes later, it&#8217;s serving up zones or anything else we need to have it doing.</p>
<p>I can command the entire thing &#8211;without ever touching the production boxes by<br />
hand&#8211; with nothing but a text editor, programming environment of choice and a<br />
git/svn client. In fact, with TortoiseSVN, we even have our first-tier user<br />
support staff making changes to the repository. Even if they screw it up, the<br />
changes never make it to production.</p>
<p>You keep talking about the right tool for the job, but if you&#8217;re maintaining a<br />
large BIND installation using pico, ssh and for-loops, you&#8217;re not following<br />
your own advice. No wonder you like AD.</p>
<p>Frankly, I can&#8217;t imagine a scenario where UNIX doesn&#8217;t have the right _set_<br />
&#8211;not necessarily a single uber one&#8211; of tools for any particular job. The<br />
right-tool-for-the-job mantra is usually just personal bias thinly veiled as<br />
pragmatism. If you like MS junk, fine; keep using it. Your experience is still<br />
only anecdotal.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.354 seconds -->

