I have an IP address of a computer which I am currently away from, and I need the MAC address. How do I get the MAC address if I ony have the IP?


In short the answer will be you can't.

It is usually not possible for a person to get the MAC address of a computer from its IP address alone. These two addresses originate from different sources. Simply stated, a computer's own hardware configuration determines its MAC address while the configuration of the network it is connected to determines its IP address.

However, computers connected to the same TCP/IP local network can determine each other's MAC addresses. The technology called ARP - Address Resolution Protocol included with TCP/IP makes it possible. Using ARP, each computer maintains a list of both IP and MAC addresses for each device it has recently communicated with.

  • 5
    And that short answer is wrong. One can always do an ARP lookup to determine the MAC of an IP. The only thing is that you probably are not seeing the actual IP of a device (due to NAT), if you're on separate networks. – antichris Jul 30 '14 at 9:42
  • 8
    The above comment is wrong. If you do an ARP lookup for an IP that's not on the same network, you will generally get no reply. There are some cases where ARP masquerading is configured and will reply, but it's quite rare to do that as it causes other problems. – pjc50 Jul 30 '14 at 9:49
  • 3
    @pjc50 Getting no replay does not prevent one from attempting an ARP lookup. My main point is that you can always do a lookup. And, if you're on the same network, you will always get what you were looking for. That's how the Ethernet protocol works. Otherwise there would be no IP packet exchange on the network, because NICs would not be able to resolve IPs to MACs. – antichris Jul 30 '14 at 9:53
  • 5
    @U-D13 I have an IP address of a computer which I am currently away from ,in the question probably meant that the user is trying to find the MAC address of a computer which is not on the same network. So in that case the answer is right – Shiva Jul 30 '14 at 9:57
  • 3
    @Shiva "probably meant". I can be away from my colleagues computer, but we're on the same network. I can be working from home via VPN and be away from my actual work machine, yet we're still on the same network. I strongly believe your answer should be reworded to clearly indicate that one can only resolve IPs to MACs in a local network, but one can always do that. – antichris Jul 30 '14 at 10:04

If you are on the same network you can open up a Terminal:

ping your_ip_address

hit Ctrl-C on the keyboard to stop pinging then do a:

arp -a

a list should appear, look for the ip you just pinged and next to it is the MAC address of the device.

  • 7
    this should be accepted as the answer – L93 Mar 15 '16 at 8:08
  • I agree too. +1 – Benjamin Fuentes Apr 26 '16 at 14:39
  • Does this works on Linux? Tried and definitely works on windows 10. – Syaiful Nizam Yahya Sep 8 '16 at 8:04
  • 3
    This only works if both hosts are on the same network, if it is in a virtual network for example it will not work – Alexandre Neukirchen May 19 '17 at 14:08
  • 2
    As one command, and suppressing the ping output and irrelevant MAC addresses: IP=; ping -c 1 "$IP" >/dev/null && arp -a | grep "$IP" – tanius Mar 31 '18 at 16:25

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