that appear on the same line as domains. The default is `false` since some
router-based implementations can't handle comments in-line with hosts.
-`--skipstatichosts`, or `-s`: `false` (default) or `true`,
-
`--noupdate`, or `-n`: skip fetching updates from hosts data sources.
`--output <subfolder>`, or `-o <subfolder>`: place the generated source file
section at the top, containing lines like `127.0.0.1 localhost`. This is
useful for configuring proximate DNS services on the local network.
+`--compress`, or `-c`: `false` (default) or `true`, *Compress* the hosts file
+ignoring non-necessary lines (empty lines and comments) and putting multiple
+domains in each line. Reducing the number of lines of the hosts file improves
+the performances under Windows (with DNS Client service enabled).
+
## How do I control which sources are unified?
Add one or more *additional* sources, each in a subfolder of the `data/`
default=False, action="store_true",
help="Compress the hosts file "
"ignoring non-necessary lines "
- "(empty lines and comments)."
- "Improve the performances "
- "under Windows.")
+ "(empty lines and comments) and "
+ "putting multiple domains in "
+ "each line. Improve the "
+ "performances under Windows.")
global settings
lines_index = 0
for line in input_file.readlines():
line = line.decode("UTF-8")
- if line.startswith('#') or line.startswith('\n'):
+ if line.startswith(('#', '\n')):
continue
if line.startswith(target_ip):