Green YGreck Guides FR
🍎 macOSIntermediate⏱ 5 min5 steps

Flush DNS and change DNS servers

Unblock a site that no longer resolves and try other DNS.

  1. Flush the DNS cache:
    sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  2. List the network services:
    networksetup -listallnetworkservices
  3. Set DNS servers (e.g. Cloudflare and Quad9) on Wi-Fi:
    networksetup -setdnsservers Wi-Fi 1.1.1.1 9.9.9.9
  4. Go back to the DNS provided by your router:
    networksetup -setdnsservers Wi-Fi empty
  5. Test name resolution:
    dig example.com +short