Was setting up a new domain with Cloudflare nameservers and installing WordPress on a VPS. After changing the nameservers and configuring the DNS A records, the website loaded fine on my phone — but wouldn't load in the browser on my Mac, even though both were on the same WiFi.
The Problem
After pointing a domain to a new VPS via Cloudflare DNS, my Mac kept serving the old (non-existent) destination. Other devices had no issue — the DNS propagation was fine everywhere else.
Why This Happens
macOS caches DNS records locally. When you change DNS settings, your Mac may hold onto the old cached record for minutes or hours, even when the upstream DNS has already updated. Each device has its own DNS cache TTL, which is why the phone worked but the Mac didn't.
The Fix
Flush the DNS cache on macOS with this single command:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderThis clears all locally cached DNS entries and forces macOS to query the updated records fresh. Run it, wait a few seconds, and reload the page.
Works on macOS Ventura, Sonoma, and Sequoia.