Add support for HOSTS.TXT
files
#7014
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull-request adds support for Hosts files that use a
.txt
extension.In-the-wild usage checks out, though I'm not sure how many
.txt
files named “hosts” would be misclassified by this addition. In any case, it doesn't appear as if heuristics support filenames in addition to extensions, so I'll avoid assuming too much for the time being./cc @larsbrinkhoff I noticed you forked the legacy HOSTS.TXT tables, so you might have input concerning the (mis)classification of files named
hosts.txt
.Checklist
extensionfilename to a language.~2,400 search results for files named
hosts.txt
.filenames/hosts
: My MacBook's (old)12/etc/hosts
file, which only contains commonly-used defaults.3filenames/hosts.txt
: Heavily-truncated copy of the NSA Blocklist, released under the MIT licenseThis was necessary because of the circuitous way in which we disambiguate between different
.txt
files. I don't know if filename conflicts can be resolved by heuristics in the way that file extensions are.Footnotes
https://github.com/Alhadis/.files/blob/4b6e915/etc/install/README.md?plain=1#L71-L78 ↩
https://github.com/Alhadis/.files/blob/4b6e915/etc/install/README.md#:~:text=Update%20/etc/hosts ↩
https://superuser.com/q/241642 ↩