Just the title, what the difference between them?
In python, socket.gethostbyname(socket.gethostname()) and socket.gethostbyname(socket.getfqdn()) return different results on my computer.
The hostname is not the fully qualified domain name, hence why they return different results.
getfqdn() will return the fully qualified domain name while gethostname() will return the hostname.
what's the difference between gethostname and getfqdn?