Disabling/Locking Firefox DOH Setting

  1. Create a file called local-setting.js into /lib/firefox-esr/defaults/pref
    Copy and paste the following:
    pref("general.config.obscure_value", 0); // only needed if you do not want to obscure the content with ROT-13
    pref("general.config.filename", "mozilla.cfg");

  2. Create a file called Mozilla.cfg into /lib/firefox-esr
    Copy and paste the following into the file:
    // IMPORTANT: Start your code on the 2nd line
    lockPref("network.proxy.type", 5)
    lockPref("network.proxy.no_proxies_on", "")
    lockPref("network.proxy.socks_remote_dns", false)
    lockPref("network.trr.mode", 5)

This is good if you are an administrator and want non admin. users from turning on Firefox DOH. Only lockPref("network.trr.mode", 5) is needed in the above code to turn off DOH. The rest are for other network settings in Firefox.

Note that Pi-hole already provides the required response when Firefox queries the canary domain. When this response is received, Firefox knows not to automatically enable DoH.


If the Firefox user has manually changed the setting to enable DoH, the response from the canary domain is ignored and DoH will be enabled per the user request.

I did see that just recently. lockPref("network.trr.mode", 5) grays out the option in Firefox and 5 = uncheck the DOH the box. This will prevent any non admin. from changing the setting.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.