Skip to content

Instantly share code, notes, and snippets.

@julianduque julianduque/dns.md

Last active May 29, 2018
Embed
What would you like to do?
DNS Command Line Configuration on macOS

DNS Command Line Configuration on macOS

The following commands work on macOS High Sierra, not tested in previous versions

Get DNS Resolvers

$ scutil --dns | grep 'nameserver\[[0-9]*\]'

Change DNS Resolvers

$ networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4

Reset DNS Resolvers (Default)

$ networksetup -setdnsservers Wi-Fi empty

Flush DNS Cache (High Sierra)

$ sudo killall -HUP mDNSResponder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.