how to get a list of all the hosts on the intranet around my workstation?

Chris Angelico rosuav at
Sat Jul 16 14:19:57 EDT 2011

On Sun, Jul 17, 2011 at 4:04 AM, Emile van Sebille <emile at> wrote:
> On 7/16/2011 9:52 AM Chris Angelico said...
>> I'd say there's several imperfect options, and no perfect ones.
>> 1) DHCP, which hosts may or may not be using.
>> 2) DNS - look up a list of the hosts within a (sub)domain.
>> 3) Send out a broadcast ping and hope they all respond.
> Or try nmap and parse it's results.

Or that, which has the same risk as #3 - basically it means doing some
network traffic to find what systems are around. It's still imperfect,
because it's likely that a down server will simply not be in the list
- someone could go through all the hosts on the list, ping them all,
and think that everything's fine.

But yes, nmap is more reliable than a broadcast ping, for what it's worth.


More information about the Python-list mailing list