Skip to content

Instantly share code, notes, and snippets.

@mipmip
Created February 16, 2012 12:00
Show Gist options
  • Star 27 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save mipmip/1844353 to your computer and use it in GitHub Desktop.
Save mipmip/1844353 to your computer and use it in GitHub Desktop.
Mac OS X: restart mDNSResponder
Load up Terminal (Applications > Utilities > Terminal.app) and type the following.
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
To turn it back on, just do the opposite:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
@kopepasah
Copy link

This worked like a charm.

I've tried sudo killall -INFO mDNSResponder over and over to no avail.

Thanks for the code.

@martinburger
Copy link

For me sudo killall -HUP mDNSResponder works (http://support.apple.com/kb/ht5343).

@pavelbinar
Copy link

Thanks for sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

@slhck
Copy link

slhck commented Aug 25, 2018

➜ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

/System/Library/LaunchDaemons/com.apple.mDNSResponder.plist: Operation not permitted while System Integrity Protection is engaged

Does not seem to be possible with macOS when SIP is enabled.

@dushyant-basson
Copy link

@slhck yes, same here, on macOS Mojave.

@jasonnerothin
Copy link

Takes two reboots, but you can turn off sip, restore dns to sanity and then turn sip back on: Instructions here: https://www.imore.com/how-turn-system-integrity-protection-macos

@pupitmiser
Copy link

Stop:
sudo killall -STOP mDNSResponder

Start:
sudo killall -CONT mDNSResponder

@zakkg3
Copy link

zakkg3 commented Mar 10, 2023

sudo killall -HUP mDNSResponder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment