import sys, sockethostname = socket.gethostname()# Try to get the fully-qualified name.print "Fully-qualified name:", socket.getfqdn(hostname)