socket.getfqdninfo(name)
- This function returns the fully qualified domain name of
name - If
nameis ommitted, the local machine is assumed -
A fully qualified domain name consists of two parts:
- The hostname
- The domain name
- For example, the fqdn for a hypothetical mail server might be
mymail.somecolleget.edu - Essentially, an fqdn must identiy the server program that an Internet request is addressed to
Example of getfqdninfo
>>> import socket
>>> socket.getfqdn('google.com')
'ord36s01-in-f14.1e100.net'References
Previous
Next