Closed Bug 1616252 Opened 5 years ago Closed 4 years ago

Maybe add a /etc/hosts parser

Categories

(Core :: Networking: DNS, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
83 Branch
Tracking Status
firefox83 --- fixed

People

(Reporter: valentin, Assigned: valentin)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged][trr])

Attachments

(1 file)

We've been avoiding this for a while, mostly because the system resolver already checks this file. But lately we've encountered some issues that seem to require us parsing the file.

We should make sure we can handle very large hosts files. We can test the parser on file generated by AdAway. The generated hosts file on my phone has 48000 lines.

Thanks for the info, Michal.
I've been thinking that we probably don't want to enable it on Android at the moment, considering TRR isn't enabled there.
However, Android is a great testcase for parsing a big file with limited hardware resources, so I'll make sure to test it before we ship it.

Assignee: nobody → valentin.gosu
Severity: normal → S3
Priority: P3 → P2
Blocks: doh
Attachment #9176491 - Attachment description: Bug 1616252 - Maybe add a /etc/hosts parser → Bug 1616252 - Exclude domains in /etc/hosts from TRR r=dragana
Attachment #9176491 - Attachment description: Bug 1616252 - Exclude domains in /etc/hosts from TRR r=dragana → Bug 1616252 - Maybe add a /etc/hosts parser
Attachment #9176491 - Attachment description: Bug 1616252 - Maybe add a /etc/hosts parser → Bug 1616252 - Exclude domains in /etc/hosts from using TRR
Pushed by valentin.gosu@gmail.com: https://hg.mozilla.org/integration/autoland/rev/2b1366e8c8ee Exclude domains in /etc/hosts from using TRR r=necko-reviewers,dragana
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
Regressions: 1668721
Regressions: 1668744

I know this issue is resolved, but I want to mention that Firefox fails to parse a large hosts file (mine has 42000 entries a.t.m).
Happens in a fresh profile as well.

FWIW, Chromium-dev 95.0.4624.0 with DoH enabled (same provider, Quad9) does parse the large file.

A hosts file with only 1 entry is parsed, however it takes some time to display the error message.

Linux Mint 19.3; Firefox 91.0.2

Modified preferences:

network.trr.blocklist_cleanup_done ---> true  
network.trr.custom_uri --- > https://dns.quad9.net/dns-query  
network.trr.mode --- > 2  
network.trr.request_timeout_ms --- > 4000  
network.trr.uri --- > https://dns.quad9.net/dns-query
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: