Overview
DNS (Domain Name System) configuration on macOS affects every network connection. This guide covers the basics of changing DNS servers, flushing the DNS cache, and configuring DNS via MDM for enterprise environments.
Changing DNS via System Settings
Go to System Settings → Network → Wi-Fi (or Ethernet) → Details… → DNS. Click + to add a DNS server. Common choices:
- Cloudflare:
1.1.1.1and1.0.0.1 - Google:
8.8.8.8and8.8.4.4 - OpenDNS:
208.67.222.222and208.67.220.220
Flushing DNS Cache
# Flush DNS cache (macOS Monterey and later)
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
# Verify DNS resolution
dig +short apple.com @1.1.1.1
nslookup apple.com 8.8.8.8
DNS via MDM (Jamf / Kandji)
Push a DNS Settings payload in a configuration profile to enforce corporate DNS servers on managed devices. In Jamf Pro, navigate to Computers → Configuration Profiles → + New → DNS Settings. You can configure DNS over HTTPS (DoH) or DNS over TLS (DoT) for additional privacy.
Troubleshooting DNS
# Show current DNS servers
scutil --dns | grep nameserver
# Test specific DNS server
dig apple.com @8.8.8.8
# Check mDNS (Bonjour) status
dns-sd -q _services._dns-sd._udp.local PTR