iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
To view IP addresses of LAN devices from the command line in macOS, use arp -a for recently discovered IPv4 neighbors, dns-sd for Bonjour services, or Nmap’s nmap -sn for a broader authorized subnet scan. No single built-in macOS command reliably lists every device on the LAN.
The right command depends on whether you need the Mac’s own address, devices macOS already knows about, advertised services, or a point-in-time scan of the whole local IPv4 subnet.
Key takeaways
arp -ashows IPv4 neighbors in macOS’s ARP cache, but it is not a complete inventory of every LAN device.route -n get defaultidentifies the interface used for the default route and usually reveals the local gateway.dns-sddiscovers Bonjour services such as printers, HTTP interfaces, SMB shares, and SSH advertisements, not every host on the network.- Nmap’s
-snoption performs host discovery without a full port scan, but Nmap must be installed separately and the scan can still miss isolated, sleeping, or filtered devices. - The subnet must be derived from the Mac’s actual IP address and netmask instead of assuming that every home network uses
192.168.1.0/24.
Which command should I use to view IP addresses of LAN devices from the command line in macOS?
Use the command that matches the information you need:
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11| Goal | Command | What the result means |
|---|---|---|
| Find the Mac’s own IPv4 address | ipconfig getifaddr en0 |
Prints the address assigned to the specified interface. |
| Find the active interface and router | route -n get default |
Shows the default gateway and the interface used to reach it. |
| View recently known IPv4 neighbors | arp -a |
Displays entries currently in the ARP neighbor cache. |
| View IPv6 neighbors | ndp -a |
Displays entries in the IPv6 neighbor cache. |
| Find advertised Bonjour services | dns-sd -B _services._dns-sd._udp |
Browses service types announced on the local network. |
| Discover hosts across an IPv4 subnet | nmap -sn 192.168.1.0/24 |
Performs host discovery across the specified CIDR range. |
For most troubleshooting tasks, start by identifying the interface and subnet, run arp -a, and then use Nmap if the cache is incomplete. Use dns-sd when the goal is to find a printer, Mac, media device, or web interface that advertises a Bonjour service.
Popular on Amazon
- DUAL-BAND WIFI 6 ROUTER: Wi-Fi 6(802.11ax) technology achieves faster speeds, greater capacity and reduced network congestion compared to the previous gen. All WiFi routers require a separate modem. Dual-Band WiFi routers do not support the 6 GHz band.
- AX1800: Enjoy smoother and more stable streaming and gaming with 1.8 Gbps total bandwidth (up to 1200 Mbps on 5 GHz and up to 574 Mbps on 2.4 GHz). Actual speeds cannot exceed your internet plan and vary based on conditions, distance, and obstacles.
- CONNECT MORE DEVICES: Wi-Fi 6 technology communicates more data to more devices simultaneously using revolutionary OFDMA technology
- EXTENSIVE COVERAGE: Achieve the strong, reliable WiFi coverage with Archer AX1800 as it focuses signal strength to your devices far away using Beamforming technology, 4 high-gain antennas and an advanced front-end module (FEM) chipset
- OUR CYBERSECURITY COMMITMENT: TP-Link is a signatory of the U.S. Cybersecurity and Infrastructure Security Agency’s (CISA) Secure-by-Design pledge. This device is designed, built, and maintained, with advanced security as a core requirement.
How do I find the Mac’s active network interface?
route -n get default is the best first command because it shows which interface macOS currently uses for the default route. Run:
route -n get default
Look for output similar to:
gateway: 192.168.1.1
interface: en0
The value after interface:, such as en0, is the interface to inspect. Do not assume that Wi-Fi is always en0 or en1; interface numbering varies between Macs and configurations.
To associate user-facing hardware names such as Wi-Fi or Ethernet with short interface names such as en0 and en1, run:
networksetup -listallhardwareports
Apple documents networksetup -listallhardwareports for associating hardware ports with their short device names in its interface-selection guidance. VPNs, virtual machines, containers, internet sharing, and simultaneous Ethernet and Wi-Fi connections can add interfaces or routes, so verify the interface instead of copying an example.
How do I display the Mac’s own LAN IP address?
After identifying the interface, pass its name to ipconfig getifaddr. For example:
ipconfig getifaddr en0
If the active interface is en1, run:
ipconfig getifaddr en1
A more detailed view includes the IPv4 address, netmask, and broadcast address:
ifconfig en0
Find the inet line when discussing IPv4. Ignore the inet6 lines for this particular calculation. Example:
inet 192.168.1.42 netmask 0xffffff00 broadcast 192.168.1.255
A compact command can select the default-route interface automatically and print its IPv4 address:
iface=$(route -n get default 2>/dev/null | awk '/interface:/{print $2}')
ipconfig getifaddr "$iface"
This command reports the Mac’s address only; it does not discover other devices.
| Address or value | Meaning |
|---|---|
192.168.1.42 |
A private IPv4 address on the local network. |
127.0.0.1 |
IPv4 loopback; it refers to the Mac itself and is not a LAN address. |
fe80::... |
An IPv6 link-local address scoped to a local interface. |
| Public/WAN address | An address assigned by an internet provider or upstream router, not normally the Mac’s private LAN address. |
Private IPv4 addresses commonly fall within 192.168.0.0/16, 172.16.0.0/12, or 10.0.0.0/8. The private address is the value normally needed when identifying the Mac from another device on the same local network.
Also popular on Amazon
- 𝐅𝐮𝐭𝐮𝐫𝐞-𝐑𝐞𝐚𝐝𝐲 𝐖𝐢-𝐅𝐢 𝟕 - Designed with the latest Wi-Fi 7 technology, featuring Multi-Link Operation (MLO), Multi-RUs, and 4K-QAM. Achieve optimized performance on latest WiFi 7 laptops and devices, like the iPhone 16 Pro, and Samsung Galaxy S24 Ultra.
- 𝐁𝐄𝟔𝟓𝟎𝟎 𝟔-𝐒𝐭𝐫𝐞𝐚𝐦, 𝐃𝐮𝐚𝐥-𝐁𝐚𝐧𝐝 𝐖𝐢-𝐅𝐢 – Enjoy seamless 4K/8K streaming, AR/VR gaming, and more with speeds up to 5764 Mbps (5 GHz) and 688 Mbps (2.4 GHz). Actual speeds cannot exceed your internet plan and vary based on conditions, distance, and obstacles.
- 𝐖𝐢𝐝𝐞 𝐂𝐨𝐯𝐞𝐫𝐚𝐠𝐞 𝐰𝐢𝐭𝐡 𝐒𝐭𝐫𝐨𝐧𝐠 𝐂𝐨𝐧𝐧𝐞𝐜𝐭𝐢𝐨𝐧 - Get up to 2,400 sq. ft. max coverage for up to 90 devices at a time. 6x high performance antennas and Beamforming technology, ensures reliable connections for remote workers, gamers, students, and more.
- 𝐔𝐥𝐭𝐫𝐚-𝐅𝐚𝐬𝐭 𝟐.𝟓 𝐆𝐛𝐩𝐬 𝐖𝐢𝐫𝐞𝐝 𝐏𝐞𝐫𝐟𝐨𝐫𝐦𝐚𝐧𝐜𝐞 - 1x 2.5 Gbps WAN/LAN port, 1x 2.5 Gbps LAN port and 3x 1 Gbps LAN ports offer high-speed data transmissions.³ Integrate with a multi-gig modem for gigplus internet.
- 𝐎𝐮𝐫 𝐂𝐲𝐛𝐞𝐫𝐬𝐞𝐜𝐮𝐫𝐢𝐭𝐲 𝐂𝐨𝐦𝐦𝐢𝐭𝐦𝐞𝐧𝐭 - TP-Link is a signatory of the U.S. Cybersecurity and Infrastructure Security Agency’s (CISA) Secure-by-Design pledge. This device is designed, built, and maintained, with advanced security as a core requirement.
How do I find the local router and calculate the scan subnet?
Run the following command to display the default gateway and route interface:
route -n get default
The gateway line usually identifies the local router, while the interface line identifies the route’s network adapter. To inspect all routes, run:
netstat -rn
Use ifconfig on the selected interface to obtain the IPv4 address, netmask, and broadcast address. For example:
ifconfig en0
Suppose the result contains:
inet 192.168.1.42 netmask 0xffffff00 broadcast 192.168.1.255
The hexadecimal netmask 0xffffff00 equals 255.255.255.0, or /24. The corresponding network is generally 192.168.1.0/24, with usual host addresses from 192.168.1.1 through 192.168.1.254 and broadcast address 192.168.1.255.
Do not blindly scan 192.168.1.0/24. A home network may instead use 192.168.0.0/24, 10.0.0.0/24, a larger subnet, or a smaller subnet. The IP address and netmask determine the correct CIDR range.
Free tools Windows power users keep installed
One-click scans. No signup required.
How do I view devices macOS already knows about with ARP?
Run:
arp -a
Typical output looks like:
? (192.168.1.1) at aa:bb:cc:dd:ee:ff on en0 ifscope [ethernet]
? (192.168.1.20) at 11:22:33:44:55:66 on en0 ifscope [ethernet]
An ARP entry can include an IPv4 address, a MAC address, the interface, and sometimes a hostname instead of ?. The command is fast, built into macOS, and useful for seeing devices the Mac has contacted recently.
arp -a is a neighbor-cache listing, not a complete LAN inventory. A device may be absent because the Mac has not communicated with it recently, the device is asleep, the device is on another VLAN, or wireless client isolation prevents peer-to-peer traffic. An entry may also be stale or incomplete.
A common optional experiment is to ping the local broadcast address and then inspect the cache:
ping -c 1 192.168.1.255
arp -a
The broadcast address must match the actual interface configuration. Some hosts and networks ignore broadcast ICMP, and modern access points may isolate wireless clients, so this method is not dependable and should not be treated as a scanner.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Another technically possible approach is to ping a range and inspect ARP afterward:
Also popular on Amazon
- 𝐆𝐢𝐠𝐚𝐛𝐢𝐭 𝐖𝐢𝐅𝐢 𝐟𝐨𝐫 𝟖𝐊 𝐒𝐭𝐫𝐞𝐚𝐦𝐢𝐧𝐠 – Up to 5400 Mbps WiFi for faster browsing, streaming, gaming and downloading, all at the same time. Performance varies by conditions, distance to devices, & obstacles such as walls.
- 𝐅𝐮𝐥𝐥 𝐅𝐞𝐚𝐭𝐮𝐫𝐞𝐝 𝐖𝐢𝐅𝐢 𝟔 𝐑𝐨𝐮𝐭𝐞𝐫 – Equipped with 4T4R and HE160 technologies on the 5 GHz band to enable max 4.8 Gbps ultra-fast connections.Power:12 V 2.5 A
- 𝐂𝐨𝐧𝐧𝐞𝐜𝐭 𝐌𝐨𝐫𝐞 𝐃𝐞𝐯𝐢𝐜𝐞𝐬 – Supports MU-MIMO and OFDMA to reduce congestion and 4X the average throughput
- 𝐄𝐱𝐭𝐞𝐧𝐬𝐢𝐯𝐞 𝐂𝐨𝐯𝐞𝐫𝐚𝐠𝐞 - Covers up to 2,000 sq. ft. High-Power FEM, 6× Antennas, Beamforming, and 4T4R structures combine to adapt WiFi coverage to perfectly fit your home and concentrate signal strength towards your devices.
- 𝐌𝐨𝐫𝐞 𝐕𝐞𝐧𝐭𝐬, 𝐋𝐞𝐬𝐬 𝐇𝐞𝐚𝐭 – Improved vented areas help unleash the full power of the router
for host in 192.168.1.{1..254}; do
ping -c 1 -W 100 "$host" >/dev/null 2>&1 &
done
wait
arp -a
This loop can generate substantial traffic, may behave differently across macOS versions because of timing options, and misses devices that block ICMP. A dedicated host-discovery tool is more robust and informative. Run either approach only on a network that you own or are authorized to test.
How do I view IPv6 neighbors from macOS?
Use macOS’s IPv6 Neighbor Discovery cache:
ndp -a
IPv6 output may look unfamiliar because devices can use long global or privacy addresses. IPv6 link-local addresses normally begin with fe80:: and require an interface scope, such as:
fe80::1234:5678:abcd:ef01%en0
ndp -a is useful for inspecting IPv6 neighbors, but it is not a guaranteed inventory of every IPv6-capable device. IPv6 privacy addresses can also change over time.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →How do I discover Bonjour devices and services?
Use dns-sd when you want to find services advertised through Bonjour, Apple’s implementation of link-local addressing, multicast DNS, and DNS-based service discovery. To list service types visible on the local network, run:
dns-sd -B _services._dns-sd._udp
The command continues running until you press Ctrl+C. Browse common service types individually:
dns-sd -B _http._tcp
dns-sd -B _ipp._tcp
dns-sd -B _smb._tcp
dns-sd -B _ssh._tcp
These searches can reveal printers, web interfaces, SMB shares, SSH services, media devices, and other advertised services. To resolve a discovered service name to its host and port, use:
dns-sd -L "Service Name" _http._tcp local
Bonjour is useful but is not a universal inventory protocol. A device that advertises no Bonjour service will not appear, and multicast discovery generally does not cross ordinary routers. Guest Wi-Fi, VLANs, multicast filtering, and wireless isolation can also prevent results. Apple describes Bonjour’s networking model in its networking API guidance, Bonjour overview, and Bonjour FAQ.
What is the most complete command-line method for scanning a local subnet?
For a broader IPv4 discovery pass, use Nmap’s host-discovery mode:
nmap -sn 192.168.1.0/24
Replace 192.168.1.0/24 with the CIDR range calculated from the Mac’s actual IP address and netmask. On a local network, elevated privileges may provide more effective discovery probes:
sudo nmap -sn 192.168.1.0/24
The -sn option tells Nmap to perform host discovery without proceeding to a full port scan. Nmap’s official target and host-discovery documentation explains CIDR target notation and host-discovery scanning.
Also popular on Amazon
- Dual-band Wi-Fi with 5 GHz speeds up to 867 Mbps and 2.4 GHz speeds up to 300 Mbps, delivering 1200 Mbps of total bandwidth¹. Actual speeds cannot exceed your internet plan and vary based on conditions, distance, and obstacles such as walls.
- Dual-band routers do not support 6 GHz.
- Covers up to 1,000 sq. ft. with four external antennas for stable wireless connections and optimal coverage.
- Supports IGMP Proxy/Snooping, Bridge and Tag VLAN to optimize IPTV streaming
- Access Point Mode - Supports AP Mode to transform your wired connection into wireless network, an ideal wireless router for home.
Nmap is not normally included with a standard macOS installation, so it must be installed separately. Homebrew users may use brew install nmap if Homebrew is already installed, but Homebrew is not the only possible installation route. The supplied research does not verify a current version-specific Nmap installation page, so check the current official Nmap distribution documentation before choosing an installer.
Recommended Free Tools
Typical output may include:
Nmap scan report for 192.168.1.1
Host is up (0.0030s latency).
MAC Address: AA:BB:CC:DD:EE:FF (Vendor Name)
Nmap scan report for 192.168.1.42
Host is up.
Nmap can report MAC addresses and registered manufacturer information most readily for hosts on the same local Ethernet segment. A MAC vendor generally identifies the registered manufacturer prefix, not the exact device model or owner.
Run scans only against networks you own or are authorized to test. Nmap produces a point-in-time observation, not a permanent asset inventory. A scan can miss sleeping devices, filtered hosts, devices on other VLANs or subnets, and clients blocked by guest-network isolation. A host being reported as up does not mean that every port or service on the host is accessible.
Can Nmap scan IPv6 networks?
Nmap supports IPv6 host-discovery syntax with the -6 option, but the target must be an IPv6 address or range appropriate to the network:
nmap -6 -sn <authorized-IPv6-target>
IPv6 discovery is more complicated than the familiar IPv4 /24 example because local addresses may be link-local and interface-scoped, while privacy addresses can change. Use ndp -a for a quick view of IPv6 neighbors and Nmap when you have a defined, authorized IPv6 target.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →How do I save or filter a LAN scan?
Save human-readable Nmap output to a text file with:
nmap -sn 192.168.1.0/24 -oN lan-hosts.txt
For automation, save XML output:
nmap -sn 192.168.1.0/24 -oX lan-hosts.xml
XML is preferable to scraping display text because Nmap’s human-readable wording can vary. For a quick visual filter, use:
nmap -sn 192.168.1.0/24 | grep -E 'Nmap scan report|Host is up|MAC Address'
To print the final field from lines that appear to be scan reports:
nmap -sn 192.168.1.0/24 |
awk '/Nmap scan report/{print $NF}'
The awk shortcut is only a convenience. It is not universally reliable because Nmap may print hostnames, IPv6 addresses, or different report formats.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteHow do I identify a device after finding its IP address?
Use a combination of reachability, name resolution, advertised services, and—when authorized—service detection:
Also popular on Amazon
- Wi-Fi 6 Speeds: Up to 2402 Mbps on 5 GHz and 574 Mbps on 2.4 GHz bands ensure smoother streaming and faster downloads; support VPN server and VPN client¹. Actual speeds cannot exceed your internet plan and vary based on conditions, distance, & obstacles.
- A More Responsive Experience: Enjoy smooth gaming, video streaming, and live feeds simultaneously. OFDMA makes your Wi-Fi stronger by allowing multiple clients to share one band at the same time, cutting latency and jitter.²
- Expanded Wi-Fi Coverage: 4 high-gain external antennas and Beamforming technology combine to extend strong, reliable, Wi-Fi throughout your home.
- Improved Battery Life: Target Wake Time helps your devices to communicate efficiently while consuming less power.
- Improved Cooling Design: No heat ups, no throttles. A larger heat sink and redefined case design cools the WiFi 6 system and enables your network to stay at top speeds in more versatile environments.
| Purpose | Command | Important qualification |
|---|---|---|
| Check basic reachability | ping -c 1 192.168.1.20 |
No ping response does not prove that the device is offline; ICMP may be filtered. |
| Reverse DNS lookup | host 192.168.1.20 |
Results depend on local or configured DNS records. |
Reverse DNS lookup with dig |
dig -x 192.168.1.20 |
A missing record is normal on many home networks. |
| Resolve a Bonjour name | dns-sd -G v4 printer.local |
Works only when the name is available through local name discovery. |
| Inspect services and versions | nmap -sV 192.168.1.20 |
This is more intrusive than host discovery and requires authorization. |
Do not infer an exact device identity solely from a MAC vendor label. Confirm identity with the router’s client list, the device’s own network settings, a Bonjour service name, or an administration interface where available.
Why are some LAN devices missing?
Missing devices usually reflect network boundaries, discovery behavior, or filtering rather than a defective command.
- Wrong subnet: The scan range may not match the interface’s actual IP address and netmask.
- Guest Wi-Fi or client isolation: The Mac may have internet access while peer-to-peer traffic to other wireless clients is blocked.
- VLANs and routed subnets: Devices on another broadcast domain are not necessarily visible to local ARP or Bonjour discovery.
- VPNs and virtual interfaces: A VPN can change routes, while containers and virtual machines can add separate networks.
- Sleeping devices: A sleeping laptop, phone, or smart-home device may not answer discovery probes.
- Host firewalls and ICMP filtering: A powered-on device can ignore ping while still running other services.
- No Bonjour advertisement: A device can be present without publishing a discoverable service.
- IPv6 versus IPv4: An IPv4 ARP lookup will not reveal IPv6-only neighbors; use
ndp -aor an appropriate IPv6 scan. - Multiple active networks: The default route may represent Wi-Fi while Ethernet connects to a different network, or vice versa.
“Same Wi-Fi name” does not guarantee that devices share the same broadcast domain. Access-point configuration, guest policies, VLANs, and router firewall rules can separate clients even when the network name looks identical.
What should I use when command-line discovery is incomplete?
Check the router’s DHCP or connected-client list when an accurate local-network picture matters. The router may show devices that peer-to-peer discovery cannot reach because of client isolation or VLAN boundaries.
A DHCP lease indicates that the router assigned or reserved an address; it does not prove that the device is currently powered on or reachable. Router firmware uses different menu names, so look for a client list, DHCP leases, attached devices, or a similar administration page.
For a practical decision tree:
- Need the Mac’s own IP? Run
route -n get default, thenipconfig getifaddrwith the reported interface. - Need recently contacted IPv4 neighbors? Run
arp -a. - Need IPv6 neighbors? Run
ndp -a. - Need a printer, Mac, media device, or advertised web service? Browse with
dns-sd. - Need a broader host list? Derive the correct CIDR range and run authorized Nmap host discovery with
nmap -sn. - Still missing devices? Compare the result with the router’s client list and check guest isolation, VLANs, VPNs, sleep state, and firewall rules.
Apple’s documentation distinguishes network configuration from discovery: networksetup can list configured services and hardware ports, but it is not a command for enumerating every peer on the LAN. See Apple’s networksetup reference for its supported configuration and information flags.
Frequently Asked Questions
Does arp -a show every device connected to my Mac’s LAN?
No. arp -a shows IPv4 neighbors currently known in macOS’s ARP cache, not every device on the subnet. Devices can be missing because they have not communicated recently, are asleep, are on another VLAN, or are isolated by the access point.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →What is the best command to scan an entire local subnet on macOS?
Nmap’s nmap -sn network/CIDR command is the best general command-line option for authorized host discovery across a known subnet. Replace the target with the subnet derived from the Mac’s actual IP address and netmask; Nmap can still miss sleeping, filtered, or isolated devices.
How do I find my Mac’s IP address without opening System Settings?
Run route -n get default to identify the active interface, then run ipconfig getifaddr with that interface, such as ipconfig getifaddr en0. The command returns the Mac’s local IPv4 address, not a list of other LAN devices.
Why does dns-sd not find a device that is connected to my network?
dns-sd discovers services advertised through Bonjour, so a connected device that advertises no relevant service will not appear. Guest Wi-Fi, VLANs, multicast filtering, ordinary routers, and wireless client isolation can also prevent Bonjour results.
The Bottom Line
There is no perfect built-in macOS LAN-inventory command. Use arp -a for a quick cached-neighbor view, dns-sd for Bonjour services, and an authorized nmap -sn scan for broader subnet discovery. If the results still look incomplete, compare them with the router’s DHCP/client list and investigate subnet boundaries, isolation, VPN routes, sleep, and firewall filtering.

