<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.scott5.org/index.php?action=history&amp;feed=atom&amp;title=Dns_subnet</id>
	<title>Dns subnet - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.scott5.org/index.php?action=history&amp;feed=atom&amp;title=Dns_subnet"/>
	<link rel="alternate" type="text/html" href="https://wiki.scott5.org/index.php?title=Dns_subnet&amp;action=history"/>
	<updated>2026-05-03T04:20:31Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://wiki.scott5.org/index.php?title=Dns_subnet&amp;diff=97&amp;oldid=prev</id>
		<title>Scott at 17:41, 31 January 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.scott5.org/index.php?title=Dns_subnet&amp;diff=97&amp;oldid=prev"/>
		<updated>2011-01-31T17:41:32Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# find all known dns entries for a class C subnet&lt;br /&gt;
# subnet (e.g. 123.45.67)&lt;br /&gt;
subnet=123.45.67&lt;br /&gt;
host=/usr/bin/host&lt;br /&gt;
if [[ $host == &amp;quot;&amp;quot; ]]; then&lt;br /&gt;
    echo &amp;quot;host program not found&amp;quot;&lt;br /&gt;
    echo &amp;quot;aborting...&amp;quot;&lt;br /&gt;
    exit 1&lt;br /&gt;
fi&lt;br /&gt;
if [[ ! -x $host ]]; then&lt;br /&gt;
    echo &amp;quot;host program $host not executable&amp;quot;&lt;br /&gt;
    echo &amp;quot;aborting...&amp;quot;&lt;br /&gt;
    exit 1&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Known DNS entries for subnet $subnet on `date`&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# main loop&lt;br /&gt;
for (( i=1; i &amp;lt;= 254; i++))&lt;br /&gt;
do&lt;br /&gt;
  ip=${subnet}.$i&lt;br /&gt;
  output=`$host $ip 2&amp;gt; /dev/null` &lt;br /&gt;
  #echo &amp;quot;output is \&amp;quot;$output\&amp;quot;&amp;quot;&lt;br /&gt;
  notfound=`echo $output | grep &amp;quot;not found&amp;quot;`&lt;br /&gt;
  if [[ -z $notfound ]]; then&lt;br /&gt;
      hostname=`echo $output | awk &amp;#039;{print $5}&amp;#039;`&lt;br /&gt;
      echo -e &amp;quot;${ip}\t${hostname}&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
	</entry>
</feed>