WHAT IS MDNSD:
mdnsd
(Multicast Domain Name System Daemon) is Android's implementation of mDNSResponder, a part of upcoming Zero Configuration Networking. It allows you to automatically discover services and appliances attached to your network:
This daemon is continuously sending multicast broadcasts (queries / advertisement) to all hosts on local network at IP address 224.0.0.251
and UDP port 5353
, also listening on the same port.
WHICH APPS USE MDNS:
Any app that makes use of Android's Network Service Discovery, will request mdnsd
running in background (1, 2, 3):
Adding NSD to your app allows your users to identify other devices on the local network that support the services your app requests. This is useful for a variety of peer-to-peer applications such as file sharing or multi-player gaming.
A quick search on forums will show many apps being blamed for excessive battery drainage becuase of using mdnsd
, e.g. Facebook and Firefox. The later has been gone through a bug in the past that caused the unexpected behavior. Now they have their own implementation of MDNS (4). Google Play Services also have built-in MDNS service (to discover Google Cast receiver devices like Chromecast) (5, 6).
Devices that support NSD include printers, webcams, HTTPS servers, and other mobile devices.
AOSP's built-in apps Print Service Recommendation Service (com.android.printservice.recommendation) and Default Print Service (com.android.bips) also make use of NSD. So if you are using printing features on your device, those would be causing mdnsd
run in background. But the most common reason is ADBD (Android Debug Bridging Daemon) which force starts mdnsd
(7).
HOW TO STOP MDNSD?
mdnsd
is an init service (8) which can be stopped by triggers. Add a few lines to /etc/init/mdnsd.rc
:
# stop mdnsd on startup
on property:sys.boot_completed=1
stop mdnsd
# stop mdnsd when adbd starts/stops
on property:init.svc.adbd=*
stop mdnsd
You can also manually stop the service anytime by executing:
~# setprop ctl.stop mdnsd
Or you can directly kill the mdnsd
program as suggested by @DBX12. The service shouldn't restart because it's oneshot
. But if it's triggered again and again by some app or the OS, you can make the binary inexecutable (or delete) at all:
~# chmod a-x /system/bin/mdnsd
However this may break some apps' functionality.
All of the above solutions require root. If your device isn't rooted, the only way is to identify and stop using the app/feature that uses Android's NSD API or directly starts mdnsd
service.