How to Change DNS Servers on a Mac

Illustration for How to Change DNS Servers on a Mac

Changing the DNS servers on your Mac can help troubleshoot websites that will not load, connection errors, or problems resolving domain names. DNS, or Domain Name System, translates website names such as example.com into the numerical IP addresses computers use to connect.

You can change DNS servers for a Wi-Fi or Ethernet connection in System Settings. The change affects that network service on your Mac and can be reversed at any time.

Quick Answer

  1. Open Apple menu > System Settings.
  2. Select Network.
  3. Choose Wi-Fi or Ethernet.
  4. Click Details next to the connected network.
  5. Select DNS.
  6. Click the + button, enter a DNS server address, and click OK.
  7. Click Apply.

Common public DNS addresses include:

  • Cloudflare: 1.1.1.1 and 1.0.0.1
  • Google: 8.8.8.8 and 8.8.4.4
  • Quad9: 9.9.9.9 and 149.112.112.112

You do not need to enter a secondary server, but adding one can provide a backup if the first server is unavailable.

What DNS Does

When you enter a website address, your Mac asks a DNS server to find the corresponding IP address. Your internet provider, router, workplace, school, or another network administrator may provide DNS servers automatically.

A different DNS service may help when:

  • Websites load inconsistently or fail to open.
  • A browser reports that it cannot find a server.
  • Your internet connection works in some apps but not others.
  • Your internet provider’s DNS service is slow or temporarily malfunctioning.
  • You want to use a DNS service with additional filtering or security features.

Changing DNS does not increase the speed of your underlying internet connection, and it cannot fix a weak Wi-Fi signal, an outage, or a problem with your router. It only changes how your Mac looks up domain names.

Change DNS Servers in System Settings

These steps apply to a network service such as Wi-Fi or Ethernet. If you regularly use both, configure each service separately.

Before you begin: Changing DNS settings can interrupt name resolution temporarily. Save important work before making network changes, especially if you are on a video call, transferring files, or using an online application.

  1. Open the Apple menu in the upper-left corner of the screen.
  2. Select System Settings.
  3. Click Network in the sidebar.
  4. Select Wi-Fi if you are connected wirelessly, or select Ethernet if your Mac uses a wired connection.
  5. Click Details next to the connected network.

For Wi-Fi, make sure you select the connected network rather than an unrelated saved network.

  1. Select DNS in the sidebar.
  2. Under DNS Servers, click the + button.
  3. Enter a DNS server address, such as:

text
1.1.1.1

  1. Press Return or click outside the field.
  2. Click + again if you want to add a second DNS server.
  3. Click OK.
  4. Click Apply in the Network settings.

Your Mac should begin using the new DNS servers for that network service. Open a browser and visit a few websites to check the connection.

Recommended DNS addresses

You can use any reputable DNS service that meets your needs. These are commonly used public addresses:

DNS service Primary address Secondary address
Cloudflare 1.1.1.1 1.0.0.1
Google Public DNS 8.8.8.8 8.8.4.4
Quad9 9.9.9.9 149.112.112.112

The secondary address is not necessarily from a different provider. It is typically another address operated by the same service.

Change DNS Servers on Older macOS Versions

Macs running older versions of macOS may use System Preferences instead of System Settings.

  1. Open the Apple menu.
  2. Select System Preferences.
  3. Click Network.
  4. Select Wi-Fi or Ethernet in the left sidebar.
  5. Click Advanced.
  6. Select the DNS tab.
  7. Click the + button below the DNS Servers list.
  8. Enter the DNS server address.
  9. Add a second address if desired.
  10. Click OK.
  11. Click Apply.

The exact appearance of these controls may vary depending on the macOS version, but the network service and DNS settings are located in the Network preferences.

Remove a Custom DNS Server

If you no longer want to use a manually added DNS server, remove it from the same settings page.

  1. Open System Settings.
  2. Go to Network.
  3. Select Wi-Fi or Ethernet.
  4. Click Details.
  5. Select DNS.
  6. Click the custom DNS address in the list.
  7. Click the – button.
  8. Click OK, then click Apply.

Repeat these steps for every custom address you added.

Removing your manually entered servers usually allows the Mac to use DNS information supplied automatically by the network. If the list contains addresses that were already present before you changed anything, avoid removing them unless you know they are custom entries.

Restore Automatic DNS Settings

The simplest way to return to the default setup is to remove the custom DNS addresses you added.

  1. Open Apple menu > System Settings.
  2. Select Network.
  3. Choose Wi-Fi or Ethernet.
  4. Click Details.
  5. Select DNS.
  6. Remove manually added addresses with the – button.
  7. Click OK.
  8. Click Apply.

Your Mac should then obtain DNS settings from the network, usually through the router. If your workplace, school, VPN, or network administrator requires specific DNS servers, automatic settings may not be appropriate.

Flush the DNS Cache

Your Mac may temporarily remember previous DNS results. If a website still fails after you change DNS servers, clearing the DNS cache can force macOS to request fresh information.

Warning: Terminal commands change system network behavior. Enter the command exactly as shown. A DNS cache flush does not delete personal files, but it may briefly interrupt connections or require websites to be reloaded.

  1. Open Terminal. You can find it in Applications > Utilities.
  2. Enter this command:

bash
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

  1. Press Return.
  2. Enter your Mac login password when prompted, then press Return.

The password will not appear on screen while you type. That is normal.

This command clears macOS’s DNS cache and restarts the system service that handles many DNS requests. It does not change the DNS server addresses configured in System Settings.

Close and reopen your browser, then try the website again. If the problem continues, disconnect and reconnect to Wi-Fi or restart the Mac.

Change DNS Servers for a Specific Network

DNS settings are tied to a network service. A change made for Wi-Fi does not automatically apply to Ethernet, a personal hotspot, or some VPN connections.

For example:

  • DNS configured under Wi-Fi applies when your Mac uses Wi-Fi.
  • DNS configured under Ethernet applies when you use a wired connection.
  • A VPN may use its own DNS settings while connected.
  • A work or school network may override local DNS choices.
  • A personal hotspot may provide different network settings from your home router.

If a problem occurs only on one connection, change DNS for that specific service instead of changing every available network interface.

Troubleshooting DNS Changes

Websites still will not load

First, confirm that the Mac is connected to the internet. Try opening several unrelated websites. If none load, the problem may be the Wi-Fi connection, router, modem, or internet service rather than DNS.

Then check the following:

  1. Return to System Settings > Network.
  2. Open the details for the active connection.
  3. Select DNS.
  4. Confirm that the addresses are entered correctly.
  5. Make sure there are no extra spaces or typing errors.
  6. Click OK, then Apply again.
  7. Flush the DNS cache using the Terminal command above.
  8. Disconnect and reconnect to the network.

Only one website is unavailable

If most websites work but one site does not, the problem may be with that website, its hosting provider, or a local browser issue. Test the site in another browser or in a private browsing window.

Changing DNS may not resolve a website outage. It also will not fix an expired domain, a server error, or a website blocked by your network administrator.

The DNS settings keep changing

A VPN, security application, management profile, or network administrator may control DNS settings. Your Mac may also receive different DNS information when you connect to another network.

Check whether the problem occurs only when a VPN is active. If so, review the VPN app’s connection or DNS settings. On a managed Mac, contact the organization that administers the device before changing network settings.

Internet access becomes worse after the change

Remove the custom DNS servers and restore automatic DNS settings. A public DNS service may be unreachable from a particular network, may filter certain domains, or may not work properly with a private network.

To reverse the change:

  1. Open System Settings > Network.
  2. Select the active connection.
  3. Click Details.
  4. Select DNS.
  5. Remove the custom addresses.
  6. Click OK, then Apply.

If necessary, restart the Mac or reconnect to Wi-Fi after restoring the settings.

Local devices stop working

Some home and business networks use their own DNS server to resolve local device names. A manually configured public DNS service may not know the names of printers, file servers, smart-home devices, or internal websites.

If local devices stop responding after the change, restore automatic DNS settings or ask the network administrator which DNS server to use. You may need the router’s local DNS address rather than a public DNS address.

The Mac connects to Wi-Fi but says there is no internet

A successful Wi-Fi connection only means that the Mac can communicate with the wireless network. It does not guarantee that the router has internet access.

Check the following:

  • Test another device on the same network.
  • Restart the router if appropriate.
  • Check whether the internet service is experiencing an outage.
  • Temporarily remove custom DNS servers.
  • Try the network’s automatic DNS settings.

If other devices also lack internet access, changing DNS on the Mac is unlikely to solve the underlying problem.

Frequently Asked Questions

Does changing DNS make Wi-Fi faster?

Not usually. DNS can affect how quickly a website name is looked up, but it does not improve Wi-Fi signal strength or increase your internet plan’s bandwidth. If Wi-Fi is slow everywhere, investigate the signal, router, interference, or internet service.

Is it safe to use a public DNS server?

Public DNS services are commonly used, but you should choose a provider you trust. DNS providers can receive information about the domain names your devices request, and some services offer filtering or security features that affect which domains resolve.

Should I use one DNS server or two?

Using two addresses from the same provider gives your Mac another server to try if the first is unavailable. If you have a specific reason to use only one server, a single address is also valid.

Do I need to change DNS on my router too?

No. Changing DNS on your Mac affects that Mac’s selected network service. Changing DNS on the router can affect multiple devices on the network, but router instructions vary by manufacturer and model.

Will changing DNS bypass blocked websites?

It may not. DNS-based blocking can sometimes be affected by using a different DNS provider, but websites can also be blocked by firewalls, parental controls, VPN policies, government restrictions, or the network administrator. Follow applicable laws and network rules.

Why can’t I edit the DNS settings?

You may not have administrator access, the Mac may be managed by an organization, or a VPN or configuration profile may control the setting. If the controls are unavailable or revert automatically, contact the person or organization managing the Mac or network.

Does changing DNS affect every browser?

DNS settings normally apply to the network connection, so they can affect browsers and other apps that use macOS network services. Some browsers and apps may use their own secure DNS feature, which can override the system setting.

Final Thoughts

To change DNS servers on a Mac, open System Settings > Network, select Wi-Fi or Ethernet, open Details, choose DNS, and add the addresses you want to use. If the change causes connection or local-network problems, remove the custom entries and return to automatic DNS settings.