---
title: "Mac network commands: networksetup, scutil, ipconfig, route · Kilobat Guides"
url: "https://kilobat.app/guides/network-settings-terminal"
description: "Read the IP address, router, DNS, proxy, routes and service order of a Mac in Terminal with networksetup, scutil, ipconfig and route."
---

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.

Applies to: All current macOS versions. · Checked: 29 October 2026

## 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.** `networksetup` reads and changes services. `scutil` shows the live DNS and proxy state. `ipconfig` shows 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

1. List the hardware ports with their device names and MAC addresses.

   ```
   networksetup -listallhardwareports
   ```
2. List the services in the order that the Mac uses them.

   ```
   networksetup -listnetworkserviceorder
   ```
3. Show the IP address, subnet mask, router and hardware address of a service.

   ```
   networksetup -getinfo Wi-Fi
   ```
4. Show the IPv4 address of a device.

   ```
   ipconfig getifaddr en0
   ```
5. Show the default router and the interface that it uses.

   ```
   route -n get default
   ```
6. Show the routing tables.

   ```
   netstat -rn
   ```
7. Show the live DNS configuration, with all resolvers.

   ```
   scutil --dns
   ```
8. Show the system proxy configuration.

   ```
   scutil --proxy
   ```
9. Show the DHCP data that the Mac accepted.

   ```
   ipconfig getpacket en0
   ```
10. Find out if a host is reachable with the current configuration.

    ```
    scutil -r apple.com
    ```

## How to fix it

1. Most `networksetup` commands that change settings need administrator rights. Read the man page first.

   ```
   man networksetup
   ```
2. Before a change, save the current values, so that you can put them back.

   ```
   networksetup -getdnsservers Wi-Fi > ~/dns-before.txt
   ```

## With Kilobat

1. Kilobat gives many of these values as JSON, for scripts and agents.

   ```
   kilobat diagnose --json
   ```
2. Show 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.

## Related guides

- [Mac uses the wrong network connection](https://kilobat.app/guides/network-service-order): When more than one connection is active, the Mac tries the service at the top of the list first.
- [Renew the DHCP lease on a Mac](https://kilobat.app/guides/renew-dhcp-lease-mac): A DHCP lease gives the Mac its IP address, router and DNS servers.
- [DNS not resolving on a Mac](https://kilobat.app/guides/dns-server-not-found): When DNS fails, the Mac cannot change a name such as apple.com into an IP address.
- [Use Wireless Diagnostics and wdutil on a Mac](https://kilobat.app/guides/wireless-diagnostics-mac): Wireless Diagnostics is a Wi-Fi tool that comes with macOS.
