Updated
How to Change the DNS Server on Mac
By Sindre Sorhus, who makes the Shortcutie app
With Shortcutie
A shortcut is faster when you switch often, like to a DNS server that blocks ads, and back:
- Install Shortcutie, and open it once.
- In the Shortcuts app, click the add button to make a new shortcut.
- Add the “Set DNS Servers” action of Shortcutie, click its field, and add the addresses, like
1.1.1.1and1.0.0.1. - Make a second shortcut with the action, but keep its field empty. It goes back to the DNS servers of your network.
- Run a shortcut, and enter your password when macOS asks for it.
The action changes the network service that your Mac uses now, like Wi-Fi or Ethernet. To see the current servers, use “Get DNS Servers”. Its result is empty when the Mac uses the DNS servers of the network.
To run the shortcuts in one click, put them in the menu bar. If a website still goes to the old address after a change, flush the DNS cache.
Get Shortcutie
Power up the Shortcuts app on Mac
$10, one-time purchase, plus tax where applicable
- Platform
- macOS
- Requires
- macOS 26 or later
- Released
- February 2025
- Privacy
- No personal data collected
- Updated
- September 2026
- Free updates
- 10
- Version
- 1.8.1
- Size
- 9 MB
- Gumroad rating
- 4.9/5 (26 ratings)
Without an app
- Open and click the network service that you use, like Wi-Fi.
- Click “Details” next to the network, and click “DNS”. You may need to scroll down.
- Click the add button below “DNS Servers”, and type the address of a server, like
1.1.1.1(Cloudflare) or8.8.8.8(Google). Add a second server in the same way. - Click “OK”.
Apple’s instructions. To go back to the DNS servers of your network, remove the servers from the list.
In Terminal, sudo networksetup -setdnsservers Wi-Fi 1 does the same for Wi-Fi, and sudo networksetup -setdnsservers Wi-Fi empty removes the servers. The settings and Terminal are enough when you change the DNS servers once.
