Finding Your Headless DHCP’d RasPi using nmap

I like as few cables as possible. And besides, many of my spare monitors don’t have an HDMI connector. So when I’m hooking up a raspi for the first time, my preferred method is to just attach ethernet and power and use nmap.

Now, if you are lucky you *might* be able to just do a ping raspberrypi, or raspberrypi.local But this depends on your DHCP server. This worked for me at the windows 7 cmd prompt, at least.

Nmap probes networks and it runs on just about any platform you can download from here

Exactly how you invoke nmap will vary from platform to platform, but here is how you would do it under the windows command prompt.

C:\"Program Files (x86)"\Nmap\nmap.exe -sP

You will also need to change your IP address range (, to your IP address range (more commonly: or

Nmap scan report for raspberrypi.home (
Host is up (0.0020s latency).
MAC Address: B8:27:EB:28:97:88 (Raspberry Pi Foundation)

If you want it to just print out the address without having to search the listing you could add this on the end:

nmap -sP | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}'

And there you have it. My raspi is at, I can now ssh to that address using putty, for instance.

More info on here: