Need to identify the MAC address of a specific computer on your network? Whether you're using Windows, macOS, or Linux, you can easily find the MAC address of any host within your local network with a few simple commands. In this guide, Mytour will show you how to use commands like arp and getmac to determine the MAC address of a specific IP or hostname, as well as how to use the nmap command to view all MAC addresses on the network.
Steps
Using the arp Command

Open the Command Prompt or Terminal window. You can use the arp command on any operating system to identify the MAC address of another computer on the network.
- On Windows, type cmd into the Windows Search bar, right-click on Command Prompt, and select Run as administrator.
- If using macOS, type Terminal into the Spotlight search bar and double-click on Terminal.
- On Linux, press Ctrl + Alt + T or open the Terminal window from your window manager.
Execute the command ping ipaddress to communicate with the IP address. You need to communicate with the remote computer so that its MAC address is added to the cache—ping is an easy way to achieve this.
- If you know the hostname of the computer but not its IP address, simply ping the hostname—the IP address will be returned for use in the next step.

Execute the command arp -a ipaddress to retrieve the MAC address. The MAC address will appear under the "Physical Address" heading in the arp results on Windows and "HWaddress" on macOS and Linux.
Using the getmac Command (Windows)

Open the command prompt. If you can log into the remote computer with administrator privileges (and it is also running Windows), you can use the getmac command to view all MAC addresses on the device. Type cmd into the Windows Search bar, right-click on Command Prompt, and select Run as administrator.

Execute the getmac command. The full command will be {{kbd|getmac /s ipaddress /u username /p password.
- Replace ipaddress with the IP address or hostname of the remote computer.
- Replace username and password with the administrator username and password of the remote computer.

Locate all MAC addresses in the "Physical Address" column. Each MAC address will appear next to the description of the interface type. If the interface is inactive, the status "Media disconnected" will display beside the MAC address.
Scan with Nmap

Install Nmap on your PC or Mac. You can use Nmap for Linux, Windows, or macOS to scan your local network and display the MAC and IP addresses of all connected devices. Download and install Nmap from https://nmap.org/download.html.

Open the Command Prompt or Terminal window.
- On Windows, type cmd into the Windows Search bar, right-click on Command Prompt, and select Run as administrator.
- For macOS, type Terminal into the Spotlight search bar and double-click on Terminal.
- On Linux, press Ctrl + Alt + T or open the Terminal window from your window manager.

Find your local IP address. To proceed, you need to know the subnet to scan.
- Windows: Execute the command ipconfig.
- macOS: Open System Preferences > Network > Advanced > TCP/IP.
- Linux: Run the command ifconfig or ip a.

Execute the nmap command. The full command will be nmap -sn xxx.xxx.xxx.*. Replace xxx.xxx.xxx.* with the network you want to scan. Shortly after, a list of all IP addresses in the network along with their corresponding MAC addresses will appear.
- For example, if your IP address is 10.0.0.3 and you want to scan all hosts in the subnet, use the command nmap -sn 10.0.0.*.
Tips
- You can only find the MAC address of a computer within the same subnet as the one you're using. It's impossible to determine the MAC address of a remote computer without logging into it.
- If the computer you're trying to access is protected by a firewall, the MAC address may not be displayed.
