Replace the target host from `0.0.0.0` with `0`.
authorSteven Black <redacted>
Wed, 23 Sep 2015 23:02:26 +0000 (19:02 -0400)
committerSteven Black <redacted>
Wed, 23 Sep 2015 23:02:26 +0000 (19:02 -0400)
readme_template.md
updateHostsFile.py

index b03b438acfb44c0b021d39034b757c5a8b49c111..2fd0ef340207b6cd7b118125a3ea6a4581f440bc 100644 (file)
@@ -47,6 +47,8 @@ For example, to nullify requests to some doubleclick.net servers, adding these l
     # etc...
 
 
+## Why use `0` instead of `0.0.0.0` or `127.0.0.1`?
+See [here](http://www.dslreports.com/forum/r16790135-Large-Hosts-file-0-0-0-0-or-127-0-0-1) and [here](http://www.dslreports.com/forum/r24621780-hosts-127-0-0-1-vs-0-0-0-0).  Turns out using just `0` increases parsing speed, and it makes the hosts file smaller.
 
 ## Location of your hosts file
 To modify your current `hosts` file, look for it in the following places and modify it with a text editor.
index af8555e3aeef18f5703f17704c05a61db238f336..1c283a4d9074b8fe22817c3ab05465a21eb233f9 100644 (file)
@@ -25,7 +25,7 @@ UPDATE_URL_FILENAME = 'update.info'
 SOURCES = os.listdir(DATA_PATH)
 README_TEMPLATE = BASEDIR_PATH + '/readme_template.md'
 README_FILE = BASEDIR_PATH + '/readme.md'
-TARGET_HOST = '0.0.0.0'
+TARGET_HOST = '0'
 
 # Exclusions
 EXCLUSION_PATTERN = '([a-zA-Z\d-]+\.){0,}' #append domain the end
@@ -185,7 +185,7 @@ def removeDups(mergeFile):
        return finalFile
 
 def normalizeRule(rule):
-       result = re.search(r'^\s*(\d+\.\d+\.\d+\.\d+)\s+([\w\.-]+)(.*)',rule)
+       result = re.search(r'^[ \t]*(\d+\.\d+\.\d+\.\d+)\s+([\w\.-]+)(.*)',rule)
        if result:
                target, hostname, suffix = result.groups()
                return hostname, "%s\t%s%s\n" % (TARGET_HOST, hostname, suffix)
git clone https://git.99rst.org/PROJECT