macOS Networking Cheat Sheet¶
Quick-reference guide for Wi-Fi, DNS, connections, and the firewall on macOS.
View Complete Interface Summary (SSID, BSSID, DHCP, IPv4/IPv6, DNS):
Run Comprehensive Apple Wireless Diagnostics (Channel, RSSI, Noise, MCS, Tx Rate):
Check Local IPv4 Address (Wi-Fi is en0 on MacBooks):
Check Public IP Address (IPv4/IPv6):
Map Hardware Ports to BSD Device Interfaces (en0, en1, bridge0):
Get Active DNS Servers for Wi-Fi:
Set Custom DNS Servers for Wi-Fi (e.g., Quad9):
Revert Wi-Fi DNS to DHCP Default:
Flush System DNS Cache:
Query DNS Resolution Using macOS Native Resolver (Respects mDNS & VPN Split-DNS):
Inspect Full System DNS Routing & Scoped Resolvers:
Run Built-in Network Throughput, Responsiveness (RPM) & Latency Test:
View Listening TCP Ports & Owning Processes:
View Active Network Connections & Socket Statistics:
Check macOS Application Layer Firewall (ALF) Status:
Enable Application Firewall & Stealth Mode (Drop Unsolicited ICMP/Probes):
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on
Check Packet Filter (pf) Firewall Status & Rules:
Sources & Verification¶
- Terminal User Guide: Apple Support
- Built-in manual pages: run
man <command>(for exampleman networksetup)