Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Replace Yosemite's DNS discoveryd with the former mDNSResponder.
if [ ! $(whoami) = 'root' ]; then
echo "This script should be run as root." > /dev/stderr
exit 1
local pid=$!
local delay=0.75
local spinstr='|/-\'
local text=$1
local count=0
echo -ne "$text "
while [ "$(ps a | awk '{print $1}' | grep $pid)" ]; do
local temp=${spinstr#?}
printf "[%c]" "$spinstr"
local spinstr=$temp${spinstr%"$temp"}
sleep $delay
printf "\b\b\b"
echo -ne "\b\b\b\n"
case "$1" in
(cp ./mDNSResponder /usr/sbin/ && cp ./mDNSResponderHelper /usr/sbin/ && cp ./ /System/Library/LaunchDaemons/ && cp ./ /System/Library/LaunchDaemons/) > /dev/null 2>&1 & spinner "copying required files"
(launchctl unload -w /System/Library/LaunchDaemons/ && launchctl unload -w /System/Library/LaunchDaemons/ > /dev/null 2>&1 & spinner "deactivating discoveryd"
(launchctl load -w /System/Library/LaunchDaemons/ && launchctl load -w /System/Library/LaunchDaemons/ > /dev/null 2>&1 & spinner "activating mDNSResponder"
echo -e "Please reboot your machine"
(launchctl unload -w /System/Library/LaunchDaemons/ && launchctl unload -w /System/Library/LaunchDaemons/ > /dev/null 2>&1 & spinner "deactivating mDNSResponder"
(launchctl load -w /System/Library/LaunchDaemons/ && launchctl load -w /System/Library/LaunchDaemons/ > /dev/null 2>&1 & spinner "activating discoveryd"
(rm -rf /usr/sbin/mDNSResponder && rm -rf /usr/sbin/mDNSResponderHelper && rm -rf /System/Library/LaunchDaemons/ && rm -rf /System/Library/LaunchDaemons/ > /dev/null 2>&1 & spinner "removing unnecessary files"
echo -e "Please reboot your machine"
echo -e "Usage: {install|remove}"
exit 1
1. Download and unzip the archive from into the same directory as the attached shell script
2. chmod +x ./
3. sudo ./ install
4. reboot your machine
To switch back to discoverd:
1. sudo ./ remove
2. reboot your machine
Copy link

rwilhelm commented Mar 6, 2015


Copy link

pagaille commented May 4, 2015

Thanks ! I'd have included the sh file into the zip archive. It works insanely well : almost every broken services are back (WOL, WOW, Disappearing shares, duplicate machine names, ...) and even Handoff and Airdrop are much more stable.

Copy link

rmm5t commented May 13, 2015

Just for future onlookers concerned about the security around downloading those binaries, here are the MD5 hashes of both that you should verify before running this script. I had these verified from multiple systems running OS X 10.9.

MD5 (mDNSResponder) = f09fd4f1a256ba622356a9fc0579a338
MD5 (mDNSResponderHelper) = 30646c984e812e157a352d24df125033

Copy link

jessedobbelaere commented May 15, 2015

Thanks! I had problems with Bonjour services ever since I upgraded to Yosemite.

Copy link

mtempels commented May 28, 2015

Wow! thanks! fixed a lot of strange wifi error after wake-up too! thanks!

Copy link

sydcanem commented Jun 26, 2015

Fixed DOTA 2 lag spikes :D

Copy link

thedevcyber commented Feb 2, 2016

@dlueth if you would be kind enough to update the links. seems broken. Thanks

Copy link

cdenneen commented Feb 18, 2016

@dlueth yes link broken to download

Copy link

vls1 commented Apr 2, 2016

THANKS A LOT! My internet connection only works on Chrome and not in Safari, Dropbox, Spotify... And you have resolved it!!!!!!!!!

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