Tutorials
Commands and settings, step by step, tested on macOS.
How to Flush the DNS Cache on Mac (Every macOS Version)
One command clears the DNS cache on every macOS version since El Capitan. Here it is, plus browser caches and when flushing actually helps.
Mac Network Commands: The Cheat Sheet
The network commands built into macOS, grouped by task, each with the one line you'll actually use. Tested on macOS 15 Sequoia.
Traceroute Command: How to Trace a Network Route
Run traceroute in Terminal to see every router between your Mac and a host, with round-trip times, and learn to read the output.
What Is My Mac Connecting To? 3 Ways to Check
See which apps on your Mac use the network and where they connect, with built-in tools or a network monitor.
arp -a: See the Devices on Your Network
arp -a shows the devices your Mac has recently talked to on the local network, with their IP and hardware (MAC) addresses.
curl -v: Debug HTTP Requests Step by Step
curl -v shows every step of a request: name lookup, connection, TLS handshake, request and response headers. Add -w to time each phase.
curl Command: Examples for Every HTTP Task
curl talks HTTP (and much more) from the terminal. These are the examples you'll actually use, from downloading a file to posting JSON to an API.
dig Command: DNS Lookups with Examples
dig is the most complete DNS tool built into macOS. Learn the commands you'll use every day and how to read its sections.
How to Change DNS Servers on Mac
Set your Mac to use a different DNS resolver such as Cloudflare, Google or Quad9, check which servers are actually used, and know when other settings override them.
How to Disable IPv6 on Mac (and When Not To)
macOS removed the IPv6 Off option from System Settings, but networksetup can still do it. Here's how, and why you usually shouldn't.
How to Edit the Hosts File on Mac
The hosts file maps names to addresses before DNS is asked. Edit it to test a site on a new server, use local development domains or block a domain.
How to Find a Wi-Fi Password on Mac
Your Mac stores every Wi-Fi password it has joined. Here are the four ways to see one, from the Passwords app to a single Terminal command.
How to Find Your IP Address on a Mac
Find your Mac's local IP (on your home network) and your public IP (what websites see), from System Settings or Terminal.
How to Find Your MAC Address on a MacBook
Your Mac has a fixed hardware MAC address and, on Wi-Fi, usually a private one per network. Here's how to find both and which one routers see.
How to Forget a Wi-Fi Network on Mac
Remove a saved Wi-Fi network so your Mac stops joining it automatically, or clear a wrong saved password.
How to Ping on Mac
Use ping in Terminal to check whether a host is reachable and how fast it answers, measure packet loss, and read every line of the output.
How to Renew a DHCP Lease on Mac
Ask your router for a fresh IP address: useful after a self-assigned 169.254 address, an IP conflict or a router change.
How to Reset Network Settings on Mac
macOS has no single “reset network settings” button. These steps go from gentle to complete, ending with a full reset of the network configuration files.
How to Scan Ports on Mac (nc and nmap)
Check which ports are open on a host with nc, built into macOS, or nmap, the full-featured scanner. Only scan devices you own or have permission to test.
ifconfig Command on Mac
ifconfig shows every network interface on your Mac with its addresses, status and settings. Here's how to read it and which interface is which.
lsof Command: Find Which Process Uses a Port or File
lsof lists open files, and on a Mac network sockets count as files. Use it to find what listens on a port, what a process is connected to, and who holds a file.
Mac Firewall Settings: Turn It On, Stealth Mode, App Rules
macOS has a built-in application firewall for incoming connections. Here's how to turn it on, use stealth mode and per-app rules, and what to use for outgoing traffic.
mtr Command: Traceroute and Ping in One
mtr combines traceroute and ping: it keeps probing every hop and shows loss and latency over time, which makes intermittent problems visible.
nc (netcat) Command: Examples
nc, the network Swiss Army knife, is built into macOS. Test ports, listen on one, send data between machines and debug protocols.
netstat on Mac: Connections, Ports and Routes
netstat shows sockets, routes and interface counters. On macOS it doesn't show which process owns a socket; pair it with lsof for that.
networkQuality: Test Your Mac's Connection from Terminal
macOS has a built-in speed test. networkQuality measures download, upload and, unusually, how responsive your connection stays under load.
nslookup Command: Query DNS from the Terminal
Use nslookup to look up a domain's addresses and other DNS records, ask a specific DNS server, and understand what “non-authoritative answer” means.
pfctl: The Mac's Built-in Packet Filter
Beneath the app firewall, macOS ships pf, a powerful packet filter. pfctl controls it: block addresses and ports, redirect traffic, and test rules.
scp Command: Copy Files over SSH
scp copies files securely between your Mac and another machine using SSH. Here's the syntax for every direction, folders, ports and keys.
Screen Sharing and Remote Login on Mac
Control another Mac's screen or log in over SSH with the tools built into macOS, and keep track of who is connected.
ssh Command: Connect, Keys and Tunnels
Everything you need for SSH from a Mac: connecting, keys, the config file, the macOS keychain, and port forwarding.
tcpdump Command: Capture Packets on macOS
tcpdump, built into macOS, captures packets on an interface. Learn the filters you need and how to save captures for Wireshark.
telnet Command: Test a Port (and What to Use on Mac)
Apple removed telnet in macOS High Sierra. nc does the same port tests, and Homebrew can reinstall telnet if you really need it.
wget Command (and How to Get It on Mac)
macOS doesn't include wget. Install it with Homebrew, or use curl, which is already there and covers most wget tasks.
whois Command: Look Up Domains and IPs
macOS includes the classic whois client. Use it to see who registered a domain, when it expires, and which organisation owns an IP block.
Wireless Diagnostics on Mac: Signal, Channels and Wi-Fi Problems
macOS includes a full Wi-Fi diagnostic tool. Learn to read signal, noise and channel data, scan your neighbourhood, and record drops.