74: Why can't Emacs talk to certain hosts (or certain hostnames)?
The problem may be that Emacs is linked with a wimpier version of
gethostbyname than the rest of the programs on the machine. This is
often manifested as a message on startup of "X server not responding.
Check your DISPLAY environment variable." or a message of "Unknown host"
from open-network-stream.
On a Sun, this may be because Emacs had to be linked with the static C
library. The version of gethostbyname in the static C library may only
look in /etc/hosts and the NIS (YP) maps, while the version in the
dynamic C library may be smart enough to check DNS in addition to or
instead of NIS. On a Motorola Delta running System V R3.6, the version
of gethostbyname in the standard library works, but the one that works
with NIS doesn't (the one you get with -linet). Other operating systems
have similar problems.
Try these options:
* Explicitly add the host you want to communicate with to /etc/hosts.
* Relink Emacs with this line in src/config.h:
#define LIBS_SYSTEM -lresolv
* Replace gethostbyname and friends in libc.a with more useful versions
such as the ones in libresolv.a. Then relink Emacs.
* If you are actually running NIS, make sure that "ypbind" is properly
told to do DNS lookups with the correct command line switch.
* Use tcp.el and tcp.c from Gnus. This has the additional advantage that
you can use numeric IP addresses instead of names. open-network-stream
currently can't handle numeric addresses. Brian Thomson
<thomson@hub.toronto.edu> has a enhancement to open-network-stream to
allow it to handle numeric addresses.