how to get host name in cmd code example Example: get hostname socket.gethostbyname(socket.gethostname())