We have multiple sites with multiple subnets. We have mandated that the admins at those sites enter DNS names for all devices that exist on the network. (anything with an IP gets a name) I want to be able to audit this and make sure this has been done.

I am able to run an individual network scan on each subnet but that takes time. I would like a way to kick off a scan that runs through all subnets once a week and gives me an output file with a list of names and IPs. (preferably csv) I have tried to do this nmap but getting a nice list of IPs and their corresponding names is not easy.

  • nmap produces nice output of the type you are looking for. Why does your scan take time?
    – schroeder
    Commented Oct 27, 2015 at 21:07
  • Also - what is your question? Note that product recommendations are off-topic (and nmap can do what you want it to)
    – schroeder
    Commented Oct 27, 2015 at 21:08
  • 1
    May want to post what you nmap command is that you're currently using. There shouldn't be a reason you can't script this.
    – KDEx
    Commented Oct 28, 2015 at 4:45

2 Answers 2


The nmap tool combined with some scripting would definitely be able to do this.

Read the nmap book Chapter 13. You might find the "grepable output" is of use: https://nmap.org/book/output-formats-grepable-output.html

This chapter even gives ideas for cutting the file into different fields.

Scanning multiple subnets is straightforward. You can feed nmap an "input list file" or you can specify multiple targets on the command line: enter link description here

As another poster noted; it'd be helpful to see what you've tried already.


You can use multiple CIDR ranges in your scans

nmap -

Here is perl module that seems to do what you want: https://metacpan.org/pod/release/APERSAUD/Nmap-Parser-0.80/tools/nmap2csv.pl

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .