Skip to content

Instantly share code, notes, and snippets.

@mzpqnxow
Last active June 22, 2023 07:58
Show Gist options
  • Save mzpqnxow/ff88b5a519f5c3303ef8bc9de0245179 to your computer and use it in GitHub Desktop.
Save mzpqnxow/ff88b5a519f5c3303ef8bc9de0245179 to your computer and use it in GitHub Desktop.
Disable MDNS in Chrome via Chrome policies on the commandline
#!/bin/bash
#
# This assumes you are using "Chrome" from the official Google site via the .deb or .rpm
# This may or may not work with your distributions "Chromium" or "Chrome" package!
#
# Run this script then restart Chrome, you will see it is no longer bound to UDP:5353
#
mkdir -p /etc/opt/chrome/policies/{managed,recommended} || echo FAIL, ARE YOU ROOT
chmod go-w /etc/opt/chrome/policies/managed || echo FAIL, ARE YOU ROOT
cat > /etc/opt/chrome/policies/managed/managed_policy.json << 'EOF'
{ "EnableMediaRouter": false }
EOF
#
# UPDATE: Unfortunately, there is another option that must be set as of latest versions of Chrome
# stable. It can not be set in the policy file but must be set manually in chrome://flags. Without
# this additional change, Chrome will still spam IGMP group requests on all interfaces at boot-time
#
# The flag is: #enable-webrtc-hide-local-ips-with-mdns
# It must be set to 'Disabled'
#
@mzpqnxow
Copy link
Author

BTW- there are probably extensions that can disable the mDNS- but a pure configuration change is so much better than adding more code to your system- even if it is (mostly) sandboxed

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