<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Shell script: list all hosts in a network in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/shell-script-list-all-hosts-in-a-network/m-p/4914852#M103841</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You could do this in a script:&lt;BR /&gt;i=0;while [ $i -le 254 ]; do nslookup 146.16.14.$i ; i=$((i+1));done&lt;BR /&gt;but it assumes that reverse lookup has been set for each IP-address on the DNS server.&lt;BR /&gt;&lt;BR /&gt;Perhaps instead of nslookup, you could get a list from the DNS server ?&lt;BR /&gt;&lt;BR /&gt;You could also tried and ping every ip-address in that segment, and see which ip-addresses that doesn't respond. But this assumes that the hosts are up and allowing icmp.&lt;BR /&gt;&lt;BR /&gt;Cheers,</description>
    <pubDate>Thu, 28 Jul 2005 04:16:27 GMT</pubDate>
    <dc:creator>Kasper Hedensted</dc:creator>
    <dc:date>2005-07-28T04:16:27Z</dc:date>
    <item>
      <title>Shell script: list all hosts in a network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-list-all-hosts-in-a-network/m-p/4914850#M103839</link>
      <description>Hi &lt;BR /&gt;i want to discover which IPs are in used in a network.&lt;BR /&gt;&lt;BR /&gt;I want to do something like:&lt;BR /&gt;&lt;BR /&gt;nslookup 146.16.14.[1-254]&lt;BR /&gt;&lt;BR /&gt;Any ideas?</description>
      <pubDate>Thu, 28 Jul 2005 04:06:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-list-all-hosts-in-a-network/m-p/4914850#M103839</guid>
      <dc:creator>Elif Gius</dc:creator>
      <dc:date>2005-07-28T04:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script: list all hosts in a network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-list-all-hosts-in-a-network/m-p/4914851#M103840</link>
      <description>use ping with broadcast address.</description>
      <pubDate>Thu, 28 Jul 2005 04:11:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-list-all-hosts-in-a-network/m-p/4914851#M103840</guid>
      <dc:creator>Martin Brachtl</dc:creator>
      <dc:date>2005-07-28T04:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script: list all hosts in a network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-list-all-hosts-in-a-network/m-p/4914852#M103841</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;You could do this in a script:&lt;BR /&gt;i=0;while [ $i -le 254 ]; do nslookup 146.16.14.$i ; i=$((i+1));done&lt;BR /&gt;but it assumes that reverse lookup has been set for each IP-address on the DNS server.&lt;BR /&gt;&lt;BR /&gt;Perhaps instead of nslookup, you could get a list from the DNS server ?&lt;BR /&gt;&lt;BR /&gt;You could also tried and ping every ip-address in that segment, and see which ip-addresses that doesn't respond. But this assumes that the hosts are up and allowing icmp.&lt;BR /&gt;&lt;BR /&gt;Cheers,</description>
      <pubDate>Thu, 28 Jul 2005 04:16:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-list-all-hosts-in-a-network/m-p/4914852#M103841</guid>
      <dc:creator>Kasper Hedensted</dc:creator>
      <dc:date>2005-07-28T04:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script: list all hosts in a network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-list-all-hosts-in-a-network/m-p/4914853#M103842</link>
      <description>Your question confuses slightly.&lt;BR /&gt;&lt;BR /&gt;If you want to find all IP addresses currently active on your subnet then do as martin says:&lt;BR /&gt;&lt;BR /&gt;# ping 146.16.14.255&lt;BR /&gt;&lt;BR /&gt;then every alive machine will respond.&lt;BR /&gt;&lt;BR /&gt;However your question also mentions nslookup, so perhaps you want to query your DNS for all IP addresses that have names?  If so then&lt;BR /&gt;&lt;BR /&gt;i=1&lt;BR /&gt;while [ i -lt 255 ]; do&lt;BR /&gt;  nslookup 146.16.14.$i | grep -i name&lt;BR /&gt;  (( i = i + 1 ))&lt;BR /&gt;done</description>
      <pubDate>Thu, 28 Jul 2005 04:17:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-list-all-hosts-in-a-network/m-p/4914853#M103842</guid>
      <dc:creator>Simon Hargrave</dc:creator>
      <dc:date>2005-07-28T04:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Shell script: list all hosts in a network</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script-list-all-hosts-in-a-network/m-p/4914854#M103843</link>
      <description>thanks all for the fast reply ...&lt;BR /&gt;Great!</description>
      <pubDate>Thu, 28 Jul 2005 04:41:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script-list-all-hosts-in-a-network/m-p/4914854#M103843</guid>
      <dc:creator>Elif Gius</dc:creator>
      <dc:date>2005-07-28T04:41:21Z</dc:date>
    </item>
  </channel>
</rss>

