How to use nmap to ping domains and get the output as domains and not IPs

networkingnmapping

I am trying to use nmap to ping a list of domains, i am using:

nmap -sP -iL /path/to/file/domains

The ping works fine but in the output for domains that ping was successful I get the domains ip like this:

Host 66.249.92.104 is up (0.55s latency).

Is there a way to get the output as domains instead of ips?

Best Answer

add the -oG ("greppable output") option.