using alternative method to get host ip address

works on linux too, more reliably than socket.gethostbyname(socket.gethostname())