I want to get the fqdn from the hostname. I am am executiong this command on a linux server: python -c "import sys, socket; sys.stdout.write(socket.gethostbyaddr('')[0])" THis command works well and returns the fqdn from the hostname. But for some other servers, it returns this error: Traceback (most recent call last): File "", line 1, in socket.herror: [Errno 1] Unknown host
When i do "host " linux command, I get the fqdn of the failed host names with python command.
Anyone have a solution for that plz?