Source

I had to do this because I have publicly routable domains in my homelab.

You can configure exceptions so that Firefox uses your OS resolver instead of DOH:

  1. Type about:config in the address bar and press Enter.
    1a. A warning page may appear. Click Accept the Risk and Continue to continue to the about:config page.
  2. Search for network.trr.excluded-domains.
  3. Click the Edit button next to the preference.
  4. Add domains, separated by commas, to the list and click on the checkmark to save the change.

Note: Do not remove any domains from the list.