socket.gethostbyname(socket.gethostname()) code example Example: socket hostname socket.gethostbyname(socket.gethostname())