summaryrefslogtreecommitdiffstats
path: root/Doc/libsocket.tex
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-01-11 17:04:56 (GMT)
committerGuido van Rossum <guido@python.org>1997-01-11 17:04:56 (GMT)
commitfe27a50847efcd1f93a8500fee0a6c7219da4493 (patch)
tree3548328c33f54cf6a79b9590a492a2efb1c26b0f /Doc/libsocket.tex
parent5709dcfaec57f014452fcd4f06abb64692f0d91f (diff)
downloadcpython-fe27a50847efcd1f93a8500fee0a6c7219da4493.zip
cpython-fe27a50847efcd1f93a8500fee0a6c7219da4493.tar.gz
cpython-fe27a50847efcd1f93a8500fee0a6c7219da4493.tar.bz2
Added warning that gethostname() doesn't always return fqdn, and show
how to find it using gethostbyaddr().
Diffstat (limited to 'Doc/libsocket.tex')
-rw-r--r--Doc/libsocket.tex5
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/libsocket.tex b/Doc/libsocket.tex
index 618c523..baf6373 100644
--- a/Doc/libsocket.tex
+++ b/Doc/libsocket.tex
@@ -96,6 +96,9 @@ Return a string containing the hostname of the machine where
the Python interpreter is currently executing. If you want to know the
current machine's IP address, use
\code{socket.gethostbyname(socket.gethostname())}.
+Note: \code{gethostname()} doesn't always return the fully qualified
+domain name; use \code{socket.gethostbyaddr(socket.gethostname())}
+(see below).
\end{funcdesc}
\begin{funcdesc}{gethostbyaddr}{ip_address}
@@ -105,6 +108,8 @@ Return a triple \code{(hostname, aliaslist, ipaddrlist)} where
alternative host names for the same address, and \code{ipaddrlist} is
a list of IP addresses for the same interface on the same
host (most likely containing only a single address).
+To find the fully qualified domain name, check \var{hostname} and the
+items of \var{aliaslist} for an entry containing at least one period.
\end{funcdesc}
\begin{funcdesc}{getprotobyname}{protocolname}