how to get a hostname from an ip code example Example: get hostname socket.gethostbyname(socket.gethostname())