I'm using Python's socket module to get the server's IP address
server_ip = socket.gethostbyname(socket.getfqdn())
I get this error:
socket.gaierror: [Errno -2] Name or service not known
Weird cause it works just fine on Fedora. Any ideas what's up?
Edit: The problem was the IP address could not be resolved to the hostname since it was not in /etc/hosts. Works fine now.