Show a Network Service's IP and Router with networksetup
networksetup -getinfo summarizes a named network service: IP, subnet mask, router, and configured DNS.
Run `networksetup -getinfo "Wi-Fi"` to see the current DHCP-assigned address, mask, router and DNS in one shot.
01Command
Command
$ networksetup -getinfo "Wi-Fi"02What it does
System Settings scatters this information across Wi-Fi details and TCP/IP tabs; -getinfo prints it in one block. The argument is the network service name, not the interface — quote it if it contains spaces. The output also shows whether the service is configured via DHCP or a manual address, which is the first thing to check when a Mac gets a 169.254.x.x address and cannot reach anything.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- networksetup — network configuration tool (macOS man page)Evidence: Documents -getinfo <service>, which prints IP address, subnet, router, client ID and DNS servers for a service.
Last verified: 2026-09-18 · Category: System & Settings