This question already has an answer here:
-
*
/questions/11580023/how-do-i-get-my-computers-fully-qualified-domain-name-in-python
/questions/11580023/how-do-i-get-my-computers-fully-qualified-domain-name-in-python
1 answer
Answers
http://docs.python.org/3.3/library/socket.html#socket.getfqdn http://docs.python.org/3.3/library/socket.html#socket.getfqdn
>>> import socket >>> socket.getfqdn() phxdbx45.phx.host.com
Source
License : cc by-sa 3.0
http://stackoverflow.com/questions/20792499/how-to-get-fully-qualified-host-name-in-python