Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 08-26-2010, 11:34 AM   #1
LQ Newbie
Registered: Nov 2009
Posts: 8

Rep: Reputation: 0
telnet fail getaddrinfo: localhost Name or service not known

This crippled a client's system this morning, and I thought I'd share the fix:
Trying to telnet into the system:
# telnet
Connected to (
Escape character is '^]'.
getaddrinfo: localhost Name or service not known
Connection closed by foreign host.

The fix was to add an entry to /etc/hosts
# grep HOSTNAME /etc/sysconfig/network
Then make an entry in /etc/hosts for the HOSTNAME exactly as it appears in the results from the above grep command, using the IP address of the network card.
This can be obtained using

# grep HOSTNAME sysconfig/network
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:25:B3:B9:14:4A
inet addr: Bcast: Mask:
... ...
The entry to put in /etc/hosts would then be: g6network

Now, what is peculiar is that the server has been running for months and telnet working just fine.
I'm guessing that automatic updates "fixed" something that wasn't necessarily broken, from the end-user's perspective.

Last edited by jijawm; 09-01-2010 at 05:36 PM.
Old 10-21-2013, 03:19 PM   #2
LQ Newbie
Registered: Oct 2013
Posts: 1

Rep: Reputation: Disabled
Thumbs up Telnet no accepting connections

Your post worked perfectly.


enterprise, getaddrinfo, linux, localhost, rhel5, telnet

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
fail to telnet localhost 106 satimis Linux - Server 7 12-16-2007 12:53 PM
telnet - FAIL: telnet address from= gruell Linux - Software 1 06-28-2007 03:41 PM
Fail to telnet localhost 25 satimis Linux - Server 19 11-27-2006 09:43 AM
can not telnet localhost 25 but telnet 25 exper Linux - Software 0 02-25-2004 05:13 AM
Telnet localhost and telnet not from localhost for IMAP services seb77 Linux - Networking 1 10-15-2003 01:20 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:28 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration