From: Mateusz Konieczny Date: Fri, 18 Mar 2016 20:10:36 +0000 (+0100) Subject: include 127.0.1.1 line X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=6395934dfa185e941c7e5d021adf8c7e76bd8e9f;p=stevenblack-hosts.git include 127.0.1.1 line partial, maybe full fix for #109 --- diff --git a/updateHostsFile.py b/updateHostsFile.py index dda1b51d0..bd8a9793a 100644 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -23,6 +23,7 @@ import tempfile import time import glob import argparse +import socket # zip files are not used actually, support deleted # StringIO is not needed in Python 3 # Python 3 works differently with urlopen @@ -382,6 +383,8 @@ def writeOpeningHeader(finalFile): writeData(finalFile, '255.255.255.255 broadcasthost\n') writeData(finalFile, '::1 localhost\n') writeData(finalFile, 'fe80::1%lo0 localhost\n') + if platform.system() == 'Linux': + writeData(finalFile, '127.0.1.1 ' + socket.gethostname() + '\n') writeData(finalFile, '\n') preamble = os.path.join(BASEDIR_PATH, "myhosts")