I need to enable telnet (no i can't use ssh, and I don't want to discuss why I have to use telnet either), I have localhost.localdomain localhost in /etc/hosts. I have installed telnet-server, chkconfigd it on, and enabled xinetd. SElinux is disabled. But every time I try and telnet to the host I get "getaddrinfo: localhost Name or service not known". Any ideas?

2 Answers 2


So I realized today that while I did ensure that "localhost" was in /etc/hosts I did not ensure that the system hostname as set in /etc/sysconfig/network was in /etc/hosts. The issue for me is that while the fqdn is in DNS, the standard in this environment is to not use the fqdn for the system hostname. So I stuck the (non-fqdn) hostname in /etc/hosts with the IP address and the issue was resolved.

I guess what has been throwing me off so bad is the error message "getaddrinfo: localhost Name or service not known". The use of localhost is a bit misleading. I hope somone else finds this information useful.

  • This is a rather common problem actually. Lots of applications break if you don't set the hostname correctly ;)
    – pehrs
    Apr 6, 2010 at 14:48
  • No kidding, which is why its "my standard" but unfortunately I cant just change "their standard" Apr 6, 2010 at 14:52

Did you edit /etc/xinet.d/telnet and set enable to yes (or on, or whatever?)

  • Indeed I did, you get a point for trying to help me offline :). Unfortunately I cannot accept my own answer as the solution. Apr 6, 2010 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.