get local hostname from ip adress i.e. 192.168.1.x python 3 on windows 10
问题 currently using:- import socket hostip='192.168.1.62' getip=socket.getaddrinfo(hostip,port=22) returns info but does not include Hostname. seems to be a local DNS problem from other discussions. The local router finds all hostnames. 回答1: Hostname is only maintained by windows or netbios, so from a command prompt it is virtually impossible to find. So I switched to searching for the ip address by referencing the Mac address. The best solution so far is to use nmap and parse the results. My