Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am running a small network with a subnet of 255.255.255.0.

I would like to run a command in either Windows command prompt or OS X Terminal that would output a list of used IP addresses. The list doesn't need to show anything other than the IP address that is taken.

Obviously, if there is a simple way of also outputting the computer/node name or something equally helpful then it would be a beneficial.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

It all depends on how you define 'used'. Nmap can easily be used to can a network for computers that are alive, assuming the firewalls permit it. The most basic command might be something like nmap -sP 192.168.0.0/16, that will just ping every address in the network and report on which systems responded. Computers that on when you run the scan will not respond. Machines with restrictive firewalls may not respond. So this method will usually miss a few computers

You can also pretty easily look at your DHCP server to see which addresses have been allocated. The DHCP database is usually very up to date, but will not show you machines that have been statically assigned.

Another way that works sometimes is to inspect the arp table on your router. Assuming your machines regularly use external services, there is going to be an entry in the arp table for addresses in use.

Machines with static addresses and extremely restrictive firewalls, that don't make external connections may be pretty difficult to find. The best method is of course to not give allocate addresses until you have updated your documentation.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.