3

I have tried the following:

$ sudo killall -HUP mDNSResponder
$ sudo killall -9 mDNSResponderHelper mDNSResponder
$ 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

None of them stop mDNSResponder from running.

Why do I want to do this? I just want to stop it before closing the lid. Because this stupid app is waking up my system when my lid remains closed. I tried many ways to avoid it running when system is at sleep. But none of them works. So the best option is just to force kill it and re-run it later. Thanks a lot.

Btw, this is not a XY question. I mean I want to stop it. The above explanation is just to clarify the reason why I want to do it, otherwise, people may ask why I want to do it and ask me not to do. Well, I really want to stop it and this is the question. The app is 100% useless to me when my system is at sleep and my lid is closed. Thanks.

  • do you know what it does ? – Ruskes Nov 29 '18 at 6:31
  • @Buscar웃 well, I didn't search for what it does. But from the name, it's just some dns service. I don't need any dns services when my system is at sleep. Even I don't need find my mac feature when my system is at sleep. When the system is at sleep, I really mean it should remain sleep and just don't do anything. thanks. – sgon00 Nov 29 '18 at 6:33
1

You cannot unload mDNSResponder on a standard setup with SIP enabled. You will have to disable SIP from Recovery mode in order to be able to do so.

I would not recommend running with SIP permanently disabled, which would be necessary if you want to periodically unload/load mDNSResponder with launchctl. So if you really want to do this (relatively obscure) thing, then I suggest permanently unloading the launch daemon, and then manually starting/stopping mDNSResponder as needed. The latter can be done with SIP enabled.

A different way to approach the issue, assuming that network traffic is the cause of the wakes, could be to let mDNSResponder run all the time, and use the built-in firewall pf to block all traffic from mDNSResponder before going to sleep, and removing the block after it wakes.

Yet another could be to take a look at the IOPlatformFeatureDefaults and check if TCPKeepAliveDuringSleep is enabled, and try disabling that. It could fix your problem potentially. You can find more information on how to do that here:

https://discussions.apple.com/message/30869802#30869802

  • Thanks a lot for the reply. My IOPlatformFeatureDefaults is OK. You can check my detail setting here. Based on the blog link and my tests, nothing can stop mDNSResponder to wake up MacOS when lid remains closed in High Sierra. Btw, blocking network and even turn off the network completely won't solve the issue. mDNSResponder will wake up the system periodically regardless the network status. What do you mean by permanently unloading the launch daemon? – sgon00 Nov 29 '18 at 10:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .