QuarkVPN

How to Change DNS Settings on Mac

On macOS, set DNS servers for the network service you use, such as Wi-Fi or Ethernet. These steps use System Settings. Before changing anything, note whether DNS is automatic and save any manually entered server addresses. On a managed Mac, use the settings your administrator provides.

Change DNS on Wi-Fi

  1. Open the Apple menu and choose System Settings > Network. Select Wi-Fi, then open Details next to the connected network.
  2. Choose DNS. Under DNS Servers, select + and enter the IPv4 or IPv6 addresses from your DNS provider, one at a time. If you are replacing a manually entered server, record its address before selecting it and clicking −.
  3. Select OK to save. Keep the TCP/IP and Search Domains settings as they were.

For example, Cloudflare's standard IPv4 addresses are 1.1.1.1 and 1.0.0.1. Use the addresses of the provider you intend to use. See Apple's DNS settings instructions and Cloudflare's IPv4 and IPv6 examples.

Change DNS on Ethernet

  1. Connect the Ethernet cable. In System Settings > Network, select the connected Ethernet service. A USB Ethernet adapter may appear under its own name.
  2. Open Details > DNS. Add the provider's addresses under DNS Servers with +, then select OK.
  3. If Wi-Fi is also connected, temporarily turn it off for a wired test. Turn it back on after verifying Ethernet. DNS changes apply to the service you edited.

Restore automatic DNS on macOS

  1. Go back to Network and open Details > DNS for the same Wi-Fi or Ethernet service.
  2. If the service previously used automatic DNS, select the manually added servers and click − to remove them. If it previously used manual DNS, re-enter the original addresses instead. Select OK.
  3. Reconnect to the same network if needed and repeat the resolver check below. The router may supply its own local address and forward your lookups upstream.

Check which DNS resolver your Mac uses

  1. Check macOS resolver settings. Open Terminal and run scutil --dns. Read the nameserver entries in the default resolver and any entries scoped to a network interface or domain. The output shows the system configuration. A VPN or a work domain can add its own resolver.
  2. Check what answers your browser's lookups. On the network you just edited, use DNS Leak Test and run a fresh Standard test. Record the resolver name and address it reports. If you configured Cloudflare, you can also use Cloudflare's resolver check.
  3. Compare the results. A router forwarding DNS can appear as a local address in Terminal while the browser test reports its upstream resolver. The browser result describes those test lookups. Other apps may use different DNS settings.

For a Windows PC, see the Windows DNS verification steps. For the difference between a resolver and the public IP a site sees, see how a DNS change affects your public IP.

How do you clear the DNS cache on a Mac?

If the DNS settings are correct but an app still appears to use an old lookup result, clear the Mac's system resolver cache and retry the app. On macOS Sonoma 14 and Sequoia 15, open Terminal from Applications > Utilities and run sudo killall -HUP mDNSResponder from an administrator account. Enter your account password if prompted. The command can finish without printing a confirmation. The signal tells the system resolver to clear its cached results while keeping the configured DNS servers. See Apple's mDNSResponder source.

Run a fresh resolver check on the same network. If apps work but the browser test still names a different resolver, check how VPN and browser Secure DNS affect the results.

How VPN and browser Secure DNS affect the result

A VPN can use its own DNS servers while it is connected, sometimes only for specific domains. A browser set to a custom Secure DNS provider can send lookups to that provider even when macOS lists a different resolver. In Chrome, check Settings > Privacy and security > Security > Use secure DNS. See Chrome's Secure DNS help.

On a trusted network, if you are allowed to disconnect the VPN, run a fresh test with it off and again with it on. Keep the network, browser, and Secure DNS setting the same. To check the effect of Secure DNS separately, keep the VPN in the same state, temporarily turn off the browser's Secure DNS if permitted, then retest and restore the original browser setting. Follow the DNS leak comparison steps to interpret the results. A resolver name alone cannot show whether the queries left the tunnel.