Closed Bug 1915085 Opened 7 months ago Closed 7 months ago

Bad name, functionality for network.trr.exclude-etc-hosts

Categories

(Core :: Networking: DNS, defect)

Firefox 129
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: u759379, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:129.0) Gecko/20100101 Firefox/129.0
Firefox for Android

Steps to reproduce:

Enable/Disable network.trr.exclude-etc-hosts in about:config tab.

Actual results:

The name for this option does not correspond to the true meaning of its operation:

  1. If true, /etc/hosts is enabled, honored (When excluded?)
  2. If false, /etc/hosts is disabled, ignored (When excluded?)

Expected results:

Based on the name, the following should happen:

  1. If true, /etc/hosts is turned off, ignored
  2. If false, /etc/hosts is turned on, honored

Let's formulate the question "Exclude /etc/hosts from TRR?":

  1. Yes, therefore /etc/hosts is disabled, ignored
  2. No, therefore /etc/hosts is enabled, honored

What is really happening "Exclude /etc/hosts from TRR?":

  1. Yes, therefore /etc/hosts is enabled, honored
  2. No, therefore /etc/hosts is disabled, ignored

How to understand this? Let's formulate the question: "Turn off the alarm?"*:

  1. Yes -> Therefore, the alarm is turned off.
  2. No -> Therefore, the alarm continues to work.

What happens if we extrapolate the actual operation of the option (network.trr.enable-etc-hosts), the question "Turn off the alarm?":

  1. Yes -> Therefore, the alarm continues to work.
  2. No -> Therefore, the alarm is turned off.
    • The initial value of the option: "network.trr.enable-etc-hosts true", implying that it is already turned on, therefore /etc/hosts is excluded from "perception".

Based on which, its name is implied as network.trr.enable-etc-hosts. Where does this exclusive OR and similar anti-logic come from when it is a direct question?

Component: Untriaged → Networking: DNS
Product: Firefox → Core

The pref name simply states whether to exclude hosts found in /etc/hosts from using TRR(DoH).
When the pref is true, hosts will be excluded from TRR, so Firefox will use the native resolver.
When the pref is false, we will not parse /etc/hosts, so Firefox will always use TRR.

Status: UNCONFIRMED → RESOLVED
Closed: 7 months ago
Resolution: --- → INVALID

(In reply to Valentin Gosu [:valentin] (he/him) from comment #1)

When the pref is true, hosts will be excluded from TRR, so Firefox will use the native resolver.
When the pref is false, we will not parse /etc/hosts, so Firefox will always use TRR.

It's confusing, as if it was intentional, if you're comfortable with this anti-logic, good luck.

You need to log in before you can comment on or make changes to this bug.