I need to find the Raspberry PI IP address on local network without connect the Raspberry to a monitor. How do I do it on Linux or Mac OS systems?

18 Answers 18


All raspberry devices MAC addresses started with B8:27:EB (for RPi4 B they start with dc:a6:32, replace where appropriate).

So, on *nix systems, this can be accomplished by executing the following command:

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

where 192.168.1.* will be your local network mask. You will get an answer like:

Nmap scan report for raspberrypi.localnetwork.lan (

The is the Raspberry Pi IP address on you network.

If you are on a Mac system you can use Homebrew to install nmap:

brew install nmap

On Windows, you might use Wireshark and use the following display filter:

eth.addr[0:3] == B8:27:EB
| improve this answer | |
  • 2
    Or with less pipes: nmap -sP | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}' – ripat Feb 26 '14 at 12:08
  • 2
    Thanks @ripat, that is a lot more concise - updated! One little detail, you need to run as administrator or the nmap will not display the MAC address. – J. Costa Feb 26 '14 at 15:13
  • 4
    You would not appreciate the importance of this answer until you have tried to headlessly locate your raspberrypi in an office setting where IP's are dished out using DHCP. Cheers for this @ripat – Voke Ransom Anighoro Apr 17 '14 at 11:53
  • 1
    This answer didn't work for me since nmap wasn't spitting out the hostnames for me. However, it did inspire me to search for open ssh ports with nmap and that did enable me to find the pi: sudo nmap -p 22 --open -sV per this guy's post. – Ross Rogers Jul 8 '15 at 17:06
  • isn't "sudo nmap -sP" enough (it wored for me)? – Marian Paździoch Dec 14 '15 at 10:54

If you're running MacOS or Linux, try this one:

$ arp -na | grep -i b8:27:eb

On windows, you can use:

arp -a | findstr b8-27-eb

On RPi 4B, you need to use different string for comparision (dc:a6:32:be:95). You can check it on your RPi by

ip -br link

There will be entries for each network card. eth0 is cable internet, wlan0 is the WiFi.

| improve this answer | |
  • 3
    This solution is much faster than an nmap solution! – ryanm Dec 29 '15 at 3:49
  • This solution worked for me, unlike the nmap solution which gave only part of the list. – Wilbert Feb 15 '16 at 7:42
  • 7
    This will only show hosts which have made it into your arp tables, so sometimes misses the quiet ones. It might help to do an nmap scan once first. – Joseph Sheedy Mar 10 '16 at 0:36
  • It might, but for me this never failed. Plus it's an easy first try. – amenthes Feb 9 '18 at 10:44
  • Thanks for this. I modified it slightly and use arp -n | awk '/b8:27:eb/ {print $1}' now. – 0x01 Apr 6 '18 at 12:02

I use mDNS/Bonjour to give my Pi a local name like pi.local. I dont need to know it's IP address and this works for shortcuts and when you need to embed a link...

How and Why to assign a local name to your Pi

| improve this answer | |
  • Awesome! I used to fiddle around with /etc/hosts locally to get this functionality on my desktop, this is a MUCH better solution! Thanks so much for the pointer! – 0x01 Apr 6 '18 at 12:10

If you want to use a GUI application for it, you can use Yakala tool (https://github.com/mozcelikors/yakala) for Debian/Ubuntu. This tool helps you not only search for available Type B and Type C networks, but also helps you to directly SSH into the network:

sudo add-apt-repository ppa:mozcelikors/yakala
sudo apt-get update
sudo apt-get install yakala


git clone https://github.com/mozcelikors/yakala
cd yakala && sudo ./install.sh


Disclaimer: I am the creator of Yakala. Any suggestions/bugs are taken very seriously.

| improve this answer | |
  • 1
    Classful networking was abandoned in 1993, which is a very long time ago. – Lightness Races in Orbit Mar 26 '18 at 17:28
  • What is classfull networking? – Denis Jun 22 '19 at 10:23

By default the raspberry's name is raspberrypi. You can just 'ping raspberrypi' and the ICMP echo reply gives you the IP address. It worked for me. Make sure though the DHCP server is reachable as the raspberry's NIC is by default in DHCP client mode. Otherwise the raspberry gets an APIPA address.

| improve this answer | |

In linux and MAC, you can also type in "arp - a" in the terminal and you can get a list of connected devices, look for the one with B8 in it, example: @ B8... will be the raspberry pi IP.

| improve this answer | |

I use the free Fing app in my android smartphone. It scans the network and shows the connected devices by type, including Raspberry Pi, as well as scanning available ports. Handy to see if SSH, web or VNC are enabled and running.

| improve this answer | |

Or you could access to your Router via browser and find your android device -almost every router GUI has a service where you can check all devices that are currently connected to your network.

| improve this answer | |

If you run MacOS, use PiFinder, it is an application that will tell you the IP of a Raspberry Pi on your network.

| improve this answer | |

Copy the following into your Terminal/Console/Shell:

for i in $(jot - 1 254); do ping -t 1 192.168.1.$i && arp -a | cut -f 2,4 -d " " | tr [:lower:] [:upper:] | grep B8:27:EB; done

Please adapt 192.168.1. to your individual network.

The output will look something like this:

( B8:27:EE:DD:CC:A would be your Raspberry Pi's IP… :)

| improve this answer | |

Put this in pi.php on your web server:

$fp = fopen('pi', 'w');
fwrite($fp, $_REQUEST['ip'],1000);

You may have to create the file pi on your web server with write permissions for your web server.


curl http://yourwebserver/pi.php -d ip=`hostname -I`

in /etc/rc.local on your pi.

Get the IP of your pi by browsing http://yourwebserver/pi

| improve this answer | |

When using a fresh install of NOOBS or Raspbian, the default hostname is "raspberrypi" and in some network configurations (i.e. if mDNS is in use and configured) you could use "raspberrypi.local". Another option is to run arp -a and look for raspberrypi

NOTE: This won't work for every instance.

| improve this answer | |
  • That answer seems to mix up several things: different IP versions, DNS, and maybe mDNS. Whether .local can be used usually doesn't depend on IPv6, and also not on having a router present. When mDNS support is available then pi-name.local resolves, IPv6 or not. Some home routers also use .local as their local DNS domain, again this is independent of IPv6 and depends on the router model. Some home routers use different domains, such as pi-name.fritz.box. – TheDiveO Feb 18 '18 at 23:35

My router assigns newly discovered systems an ip-address starting at, sequentially. I went through every system in my home one day and reserved addresses for them.

That way when I create a new system, chances are that its ip-address will be

Another way to use the serial console. You can use a serial terminal program in order to log into your raspberry pi. I would suggest using the 8N1 (8-bits, no parity bit, 1 stop bit) setting with a speed (baud rate) of 115,200. You'll need a USB to serial (3V3) connector.

| improve this answer | |

'Fing' or 'Net Analyzer' on Android. Shows your whole network.

| improve this answer | |

If you are on Windows I suggest you to try out this script. It is mostly based on the "arp -a" command, but it saves you some extra digging and helps you when your Raspberry is not already in the Arp table.

Create a text file with the following content and rename it as find_raspberry_pi.bat

@echo off
:: This script, run from a Windows (10) machine, finds a Raspberry Pi on local network

set raspIp=
set myip=
set subnet=

:: Get IP for local PC
for /f "tokens=1-2 delims=:" %%a in ('ipconfig^|find "IPv4"') do set myip=%%b
set myip=%myip:~1%
echo IP for local PC: %myip%

:: Get subnet
set subnet=%myip%
setlocal enabledelayedexpansion
for /l %%a in (1,1,31) do if NOT "!subnet:~-1!"=="." set subnet=!subnet:~0,-1!
set subnet=%subnet:~0,-1%
setlocal disabledelayedexpansion  
echo Subnet: %subnet%

:: Loop through arp table entries and look for Raspberry Pi's MAC address
for /f "tokens=1" %%f  in ('arp -a ^| findstr b8-27-eb') do (set raspIp=%%f)

if "%raspIp%"=="" (
    echo Discovering network...
    :: Ping all IPs in subnet from 1 to 254
    for /L %%N in (1,1,254) do start /b ping -n 1 -w 200 %subnet%.%%N >nul
    timeout 1 >nul
    goto :top
) else (
    echo Found Raspberry PI with IP: %raspIp%


  1. I am not the author of the original script, I just adapted it a little bit to work with a Raspberry Pi. Sadly, I cannot find the original contributor.
  2. It's not bullet-proof, it will not work if the subnet it starts scanning is not the correct one.

Still, I used it many times and it's a simple solution

| improve this answer | |

In 2020, the accepted answer does not work anymore because the Raspberry Pi ships with a different range of MAC addresses. I could just add the "new" MAC as a comment, but the string could change again and again each model. Here is something that's more future-proof.

$ sudo nmap -sP |grep 'Raspberry Pi Trading' -B2
Nmap scan report for pi4-01.lan (
Host is up (0.037s latency).
MAC Address: DC:A6:32:1B:35:6A (Raspberry Pi Trading)

The main difference above: we don't assume a MAC pattern, we just grep for the (summary), as this label is provided by nmap itself. Because nmap is continually updated, it contains internal tables of Raspberry Pi MAC addresses (or uses other criteria to detect) and we can assume that will continue working.

CAVEAT: If your scan does not identify all Pis you know are on the network, then repeat the scan -- up to 10 times. A Pi which has networking Power Management:on might not always respond to a scan.

Power Management may be a problem for you if you are scanning for multiple Pis on a LAN, as repeat scans might detect one Pi but not another. In that case, repeat the scans look for differences. (To confirm if a Pi has Power Management enabled, ssh to the Pi and run: /sbin/iwconfig wlan0|grep Management)

| improve this answer | |

I assume you cannot connect to you PI, otherwise you'd know its IP.

If you go to your router page (usually something like in your browser) there you should have a section with the already connected devices. You can try to plug and unplug the PI (and one device should appear / dissapear from the list)

| improve this answer | |

Try this first:

arp -a | grep -E --ignore-case 'b8:27:eb|dc:a6:32'

The two hex strings (b8:27:eb|dc:a6:32) in this command reflect the two OUI values used by "The Foundation" for production of all RPi devices - through RPi ver 4B as of this writing. If your RPi isn't in your arp cache this command won't yield anything useful. If that's the case, then create the following file in your favorite editor, and save/write it as pingpong.sh:


: ${1?"Usage: $0 ip subnet to scan. eg '192.168.1.'"}

for addr in `seq 0 1 255 `; do
( ping -c 3 -t 5 $subnet$addr > /dev/null ) &
arp -a | grep -E --ignore-case 'b8:27:eb|dc:a6:32'

make it executable, and run it (use your network address here, not necessarily 192.168.1.):

$ chmod 755 pingpong.sh
$ ./pingpong.sh 192.168.1. 

Your results may appear as follows:

raspberrypi3b.local ( at b8:27:eb:1:2:3 on en0 ifscope [ethernet]
raspberrypi4b.local ( at dc:a6:32:2:3:4 on en0 ifscope [ethernet]

In this case, the hostname appears courtesy of mDNS. If you don't have/don't use mDNS/avahi/etc the hostname will be replaced by the character: ?.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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