Fixes #54, #48: set the host IP in a smarter way.