get host name of computer code example Example: get hostname socket.gethostbyname(socket.gethostname())