Retrieving Network Configuration Details on macOS: The Equivalent of ipconfig /all
While Windows users rely on the command prompt utility ipconfig /all to extract comprehensive network interface data, macOS utilizes the ifconfig command and the networksetup utility to achieve the same result. macOS does not have a direct alias for ipconfig,...
While Windows users rely on the command prompt utility ipconfig /all to extract comprehensive network interface data, macOS utilizes the ifconfig command and the networksetup utility to achieve the same result. macOS does not have a direct alias for ipconfig, but the terminal environment provides even greater granularity for diagnosing network connectivity, reviewing interface status, and managing IP addressing schemes on Apple silicon and Intel-based Mac hardware.
Contents
Understanding macOS Network Architecture
In the macOS environment, network interfaces are managed through a Unix-based BSD (Berkeley Software Distribution) architecture. Unlike the Windows command-line approach, which often groups information in a simplified, human-readable block, the ifconfig utility on macOS provides a direct window into the kernel-level configuration of your network adapters.
When you seek to retrieve "ipconfig all" level data on a Mac, you are essentially asking for a dump of current IP addresses, subnet masks, hardware (MAC) addresses, broadcast addresses, and the status of the link layer. Because macOS is a Unix-compliant operating system, this information is parsed directly from the system’s interface drivers. Understanding that your Mac treats a Wi-Fi card (usually labeled en0) and an Ethernet adapter (often en1 or en2) as distinct interface objects is the first step in effective network troubleshooting.
The Primary Tool: Using ifconfig in Terminal
The ifconfig command is the standard interface configuration tool for macOS. To view your network details, you must open the Terminal application found in Applications > Utilities. Once the command-line interface is open, typing ifconfig will display a summary of every active network interface on your device.
To replicate the level of detail provided by a Windows ipconfig /all command, you should use the following command structure:
- Launch Terminal.
- Type
ifconfigand press Enter. - To focus specifically on your Wi-Fi interface (typically
en0), typeifconfig en0.
The output will display critical identifiers such as the inet (IPv4 address), netmask (subnet mask), and ether (your physical MAC address). Unlike the Windows version, ifconfig does not show the Default Gateway or DNS servers by default; those reside in the routing table and system configuration files, respectively.
Retrieving Gateway and DNS Information
If you are looking for the "all" part of the query—specifically the Default Gateway and DNS servers—ifconfig alone is insufficient. macOS separates these configurations. To find your default gateway, you must inspect the system routing table. Use the command netstat -nr | grep default to see the IP address of your router.
For DNS settings, the system file /etc/resolv.conf is the traditional repository, but in modern versions of macOS (including macOS 15 Sequoia and beyond), these settings are managed by the scutil (System Configuration utility). You can verify your active DNS servers by executing the following command in the Terminal:
scutil --dns | grep 'nameserver\[[0-9]*\]'
This command filters the voluminous output of the system configuration service to show only the IP addresses of the DNS servers currently servicing your active network connection.
Comparison of Windows and macOS Network Diagnostics
Navigating the transition from Windows diagnostics to macOS terminal commands requires a shift in perspective regarding how OS components store network data. The following table illustrates the functional equivalents between the two operating systems.
| Data Requirement | Windows (ipconfig /all) | macOS (Terminal Command) |
|---|---|---|
| Interface List/Details | ipconfig /all |
ifconfig |
| IP/Subnet/MAC Address | Displayed in output | ifconfig [interface] |
| Default Gateway | Listed in output | `netstat -nr |
| DNS Servers | Listed in output | scutil --dns |
| DHCP Lease Info | ipconfig /renew |
ipconfig getpacket en0 |
| Connectivity Check | ping |
ping |
Using the networksetup Utility
For more advanced users or those automating network management, networksetup is a powerful, native macOS tool that provides information regarding the network service order and configuration profiles. While ifconfig shows you the raw interface status, networksetup allows you to query the Service Order.
To see all network services currently configured on your Mac, use:
networksetup -listallnetworkservices
To view the specific configuration of an interface, such as the hardware port details or the TCP/IP configuration, you can use:
networksetup -getinfo "Wi-Fi" (or the name of your service).
This provides a much friendlier output than ifconfig and is often the best way to verify if your machine is set to use DHCP or a Manual IP address, which is a common requirement when troubleshooting local connectivity issues.
Troubleshooting Common Network Issues
When network connectivity fails, simply knowing the IP address is rarely enough. The most common issues arise from misconfigured subnets, conflicting IP addresses, or DNS resolution failures.
- Verify Interface Link Status: Check the status line in
ifconfig. If you seestatus: inactiveon your primary interface, the hardware may be disabled or the cable disconnected. - Review DHCP Leases: If you suspect your Mac has failed to renew its IP address from the router, use
ipconfig getpacket en0. This command outputs the full DHCP exchange, allowing you to see if the server offered an address and what information was provided (such as lease duration and router ID). - Flush DNS Cache: If you can ping an IP address (e.g.,
ping 8.8.8.8) but cannot load websites, your DNS is likely the culprit. You can reset the local cache in macOS by runningsudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder.
Advanced Diagnostic Procedures
For complex enterprise environments or private network testing, users may require information regarding the multicast state or IPv6 status. macOS supports dual-stack networking natively. ifconfig will show an inet6 entry for any interface with an active IPv6 address.
If you are investigating performance issues, netstat -I en0 provides packet statistics, including input/output errors and collisions. This is an essential diagnostic step if you are experiencing intermittent "lag" or dropped connections on a wired Ethernet connection, as it helps identify potential hardware failure or faulty cabling.
Recommended Next Actions
To maintain an accurate record of your network configuration, save your current output to a text file. This is highly recommended before modifying network settings or installing third-party VPN software, which often alters routing tables. You can export your configuration by running:
ifconfig > my_network_config.txt
If you are experiencing persistent issues that cannot be resolved through the Terminal, navigate to System Settings > Network. Select your active interface and click Details to compare the GUI-based values against the command-line outputs. Discrepancies between the two can sometimes indicate corruption in the com.apple.network.identification.plist file, which may require a system configuration reset by an authorized technician or a knowledgeable administrator.