Skip to content

Instantly share code, notes, and snippets.

@reishoku
Created May 27, 2023 12:37
Show Gist options
  • Save reishoku/d8bb566fa07a90c4377a74be5bd76c24 to your computer and use it in GitHub Desktop.
Save reishoku/d8bb566fa07a90c4377a74be5bd76c24 to your computer and use it in GitHub Desktop.
  • macOS Ventura (13.4, M1) 環境で確認済み。

Disable mDNS on macOS

  1. sudo defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool YES
  2. Reboot

Enable mDNS on macOS

  1. sudo defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool NO
  2. Reboot
@r3a1d3a1
Copy link

r3a1d3a1 commented Apr 4, 2025

1- Does it require disabling SIP ?
2- I see no such file /Library/Preferences/com.apple.mDNSResponder.plist on my system. Assuming it's just a template, can you upload it please?

@reishoku
Copy link
Author

reishoku commented Apr 5, 2025

  1. Disabling SIP is not required, as far as I know
  2. If the file does not exist, running sudo defaults write ... command is enough. The command will automatically create the file (file format is binary-encoded plist) that look like this:
reishoku@sequoia ~> file /Library/Preferences/com.apple.mDNSResponder.plist
/Library/Preferences/com.apple.mDNSResponder.plist: Apple binary property list
reishoku@sequoia ~> plutil -p /Library/Preferences/com.apple.mDNSResponder.plist
{
  "NoMulticastAdvertisements" => 1
}

For more detailed information, refer to the manpages (man 8 mDNSResponder) that comes with your macOS installation.

@r3a1d3a1
Copy link

r3a1d3a1 commented Apr 5, 2025

Great! Thank you very much!

@reishoku
Copy link
Author

reishoku commented Apr 5, 2025

Newer versions of macOS use mDNS heavily (for Handoff, etc...), so please note that there are some caveats. I think macOS will run fine without mDNS, though.

@r3a1d3a1
Copy link

r3a1d3a1 commented Apr 6, 2025

Good to know! Thanks!

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