OS X: How to disable Bonjour service advertising without disabling DNS
In some network environments, administrators may prefer that OS X not advertise services using Bonjour. You can use the steps in this article to disable Bonjour service advertising without disabling DNS.
OS X uses the mDNSResponder process for unicast DNS (Domain Name System) as well as Bonjour. Disabling the mDNSResponder process also disables unicast DNS resolution. Without unicast DNS resolution, OS X cannot resolve hostnames such as www.apple.com.
In OS X Snow Leopard and later, you can use the steps below to disable Bonjour service advertising without disabling DNS query operations, like Bonjour service discovery, and translation of host names to IP addresses.
Important: Follow these steps carefully. A malformed or problematic mDNSResponder.plist file may prevent your Mac from starting up. As a precaution, perform a full backup of your system with Time Machine before performing these steps.
- Make a back up copy of the mDNSResponder.plist file as a precaution.
- Open the mDNSResponder.plist file in Terminal using your preferred text editor. Here is a sample command:
sudo nano "/System/Library/LaunchDaemons/com.apple.mDNSResponder.plist"
- Add "<string>-NoMulticastAdvertisements</string>" to the array in the "ProgramArguments" section.
- Save the file.
Important: If you edited this file using emacs, you must remove the emacs backup file (the file with a tilde at the end of the name, "/System/Library/LaunchDaemons/com.apple.mDNSResponder.plist~") or your Mac will not start up.
- Restart your Mac.
Note: In Mac OS X v10.5 and earlier, the only way for a network administrator to disable Bonjour advertising of services is to completely disable the mDNSResponder process. This also disables Bonjour discovery of services (such as discovering network printers).