Skip to content

Instantly share code, notes, and snippets.

@julianduque julianduque/

Last active May 29, 2018
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

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.