My bad, I assumed that socket.gethostbyname would error out on the www. My fault. Please remove this.