I've read almost every thread related to this, yet no one has quite made it easy to access a table like the following.
IP Address Hostname MAC Address
192.168.1.10 | myAppleTV | 02:78:42:9b:bb:12
192.168.1.10 | myiPhone | b2:18:4a:3a:42:22
192.168.1.10 | myiMac | 09:17:a2:95:c4:00
192.168.1.10 | myCanonPrinter| a0:ea:72:77:b4:aa
Most of the time I use arp -a
and there is also dns-sb
, but none of them make it easy to find out 3 key pieces of information whenever I am messing around on the network, i.e., IP Address, Hostname and MAC Address. I am surprised that there isn't a utility that accomplishes this!
Best Answer
If using a third-party utility is not an issue for you, then I recommend giving these a try:
arp-scan (available via Homebrew)
fing (download and install the "Desktop Embedded CLI" package from fing.com or via Homebrew
brew cask install fing
)Both utilities have a number of additional modes and features. I suggest reading the manuals fully to get the most out of them.
If you need to avoid using third-party tools then here's a way to do something similar with built-in commands. You can run these interactively, but it's probably easier to save it as a script. N.B. to keep it short, this script does no error checking, and only works on /24 subnets. Modifying it to work on subnets of other sizes is left as an exercise to the reader :)
This should output something like: