Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For you and others with similar issues, add this to your .bashrc:

    function restart-discoveryd() {
        sudo launchctl unload /System/Library/LaunchDaemons/com.apple.discoveryd.plist
        sudo launchctl load /System/Library/LaunchDaemons/com.apple.discoveryd.plist
    }
Then simply run `restart-discoveryd` when you can't seem to ping google.com. I always struggle to remember how to start/stop things with launchd, so this is my little shortcut.


Try just doing

  sudo discoveryutil udnsrestartquestions
instead. The one time I had DNS issues (only once!), I ran that command and all of my DNS issues immediately resolved themselves.


I am not sure I understand what this command does, even after reading the man page for discoveryutil. Does it just restart any queries that have not been resolved, or does it restart the process as does my command? If it's the former, how does it work to fix whatever issues discoveryd is having?


It almost certainly does not restart the process.

In my short time poking around, my belief is discoveryd gets wedged into a state where it thinks DNS queries aren't resolving, and so it doesn't try to resolve them. I'm not sure what exactly is going on there, either all the queries are blocked somehow on some long-lived query that has no response and no timeout, or discoveryd thinks the network is broken and is waiting for it to come back (those are just guesses). Either way, the command tells discoveryd to restart any outstanding "questions" (which presumably means queries). When I had the issue, that was sufficient to flush out whatever it was that was blocking everything, as my machine instantly started working properly again.


Or just `killall discoveryd` and let it relaunch on its own.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: