Last active
June 22, 2023 07:58
-
-
Save mzpqnxow/ff88b5a519f5c3303ef8bc9de0245179 to your computer and use it in GitHub Desktop.
Disable MDNS in Chrome via Chrome policies on the commandline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' | |
# |
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
You can try setting the immutable flag on the configuration file after you modify it. You’ll need elevated privileges to do so, though
The simplest way to do a basic test would be to shut down all chrome instances, make the change, then sudo chattr +i . Until you chattr -i the file, it won’t be mutable by any users (not even root)
The file has to be on an ext-based file system because it uses the extfs extended attributes
You could also try just chowning it to root, but it’s possible it could be deleted and recreated as a normal user since the directory will be owned by a normal user
good luck, let me know if you figure anything out. I stopped using Chrome entirely a while ago so haven’t looked at it all on probably over a year