IP, routing and IPv6
See Mac network settings in Terminal
macOS includes command-line tools that show the same network settings as System Settings, and more. Reading settings does not need an administrator.
Symptoms
- You want to see network settings fast, or copy them for a support request.
- System Settings does not show the detail that you need.
- You want to check settings in a script.
Likely causes
- Several tools.
networksetupreads and changes services.scutilshows the live DNS and proxy state.ipconfigshows DHCP data. - Services and devices. A service has a name such as Wi-Fi. A device has a name such as
en0. Commands take one or the other.
How to check
List the hardware ports with their device names and MAC addresses.
networksetup -listallhardwareportsList the services in the order that the Mac uses them.
networksetup -listnetworkserviceorderShow the IP address, subnet mask, router and hardware address of a service.
networksetup -getinfo Wi-FiShow the IPv4 address of a device.
ipconfig getifaddr en0Show the default router and the interface that it uses.
route -n get defaultShow the routing tables.
netstat -rnShow the live DNS configuration, with all resolvers.
scutil --dnsShow the system proxy configuration.
scutil --proxyShow the DHCP data that the Mac accepted.
ipconfig getpacket en0Find out if a host is reachable with the current configuration.
scutil -r apple.com
How to fix it
Most
networksetupcommands that change settings need administrator rights. Read the man page first.man networksetupBefore a change, save the current values, so that you can put them back.
networksetup -getdnsservers Wi-Fi > ~/dns-before.txt
With Kilobat
Kilobat gives many of these values as JSON, for scripts and agents.
kilobat diagnose --jsonShow the current Wi-Fi link with signal, channel and link rate.
kilobat wifi status --json
Questions
Why does networksetup ask for a password?
The networksetup man page says that it needs at least admin rights to change network settings.
Is ipconfig the same as on Windows?
No. The macOS ipconfig talks to the IPConfiguration agent. Its man page says to use it for test and debug only.
Sources
- networksetup(8), man page installed with macOS 27.2
- scutil(8), man page installed with macOS 27.2
- ipconfig(8), man page installed with macOS 27.2
- route(8), man page installed with macOS 27.2
- netstat(1), man page installed with macOS 27.2
Sources checked on 29 October 2026. Man pages are the ones installed with macOS; open one with man <name> in Terminal.