how to get hostname from url code example Example: get hostname socket.gethostbyname(socket.gethostname())