How to Clear the macOS CoreWLAN (Wi-Fi) Cache via Terminal

The CoreWLAN Subsystem

When you click the Wi-Fi icon on your Mac’s menu bar to connect to a network, you are interacting with the CoreWLAN framework. This system daemon manages the physical Wi-Fi antenna, negotiates the WPA3 cryptographic handshakes, and maintains an extensive historical cache of every network you have ever connected to, including their BSSIDs (Mac addresses of the routers) and preferred channel configurations.

Over time, particularly if you travel frequently or work in complex enterprise environments with dozens of overlapping access points, this internal routing cache can become severely corrupted.

The symptoms of a corrupted CoreWLAN cache are incredibly frustrating: Your Mac might constantly drop its Wi-Fi connection every 5 minutes, it might stubbornly refuse to connect to a known-good network stating “Invalid Password” (even when the password is 100% correct), or the Wi-Fi interface might completely freeze, displaying a spinning beachball when you try to turn it off. Simple restarts rarely fix this because the corrupted preference files persist on the SSD. To resolve deep Wi-Fi instability, you must purge the CoreWLAN cache via the Terminal.

Locating the Cache Files

Unlike simple application caches, the Wi-Fi configuration files dictate core hardware behavior and are stored in the heavily protected SystemConfiguration directory at the root of the hard drive.

The critical files responsible for Wi-Fi state are:

  • com.apple.airport.preferences.plist (Stores known networks and hardware states)
  • com.apple.wifi.message-tracer.plist (Stores diagnostic telemetry)
  • NetworkInterfaces.plist (Maps the physical hardware to the logical en0 interface)
  • preferences.plist (The global network routing table)

Purging the Cache via Terminal

You must use the Terminal with elevated (sudo) privileges to bypass macOS System Integrity Protection and delete these hardware-level files.

  1. Turn Wi-Fi OFF from the menu bar.
  2. Open the Terminal application.
  3. Execute the following commands one by one to delete the corrupted state files:
sudo rm -f /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist
sudo rm -f /Library/Preferences/SystemConfiguration/com.apple.wifi.message-tracer.plist
sudo rm -f /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
sudo rm -f /Library/Preferences/SystemConfiguration/preferences.plist

Press Enter, type your Mac’s administrator password (the characters will remain invisible), and press Enter again.

Flushing the DNS Cache

Since we are rebuilding the networking stack, it is best practice to also flush the mDNSResponder cache, which handles local DNS resolution.

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

The Hardware Recalibration

Deleting the files from the hard drive disables the corrupted state, but the hardware is still confused in RAM.

You must immediately restart your Mac.

During the reboot sequence, the macOS kernel will initialize the Wi-Fi antenna (en0), look for the configuration files in the SystemConfiguration folder, and realize they have been obliterated. The kernel will instantly generate a completely fresh, uncorrupted set of .plist files using the factory default algorithms.

When you log back in, turn Wi-Fi ON. You will need to re-enter your Wi-Fi password (as the known networks cache was wiped), but the connection will immediately stabilize, and the sporadic dropping behavior will be permanently resolved.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.