So I found a fix: def get_ip(): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: # doesn't even have to be reachable s.connect(('8.8.8.8', 1)) IP = s.getsockname()[0] (changed the 10.255.255.255 to 8.8.8.8 -seems to do the trick!) Hopefully this helps someone! Cheers cabs