LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-02-2008, 01:35 PM   #1
ryes31
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Rep: Reputation: 0
Hostname issue - showing "localhost" instead of actual hostname.


So I've been having this problem for a few days and have searched and read through pretty much everything I could find regarding the issue and still can't get it to work. Hoping to find some help here.

Hostname issues...when I telnet into my server on port 25, it reports the hostname as being localhost:

220 localhost SMTP; Thu, 02 Oct 2008 14:21:03 -0500

I have changed the hostname on the server in just about every place I can imagine.

[root@weboflearning ~]# hostname
weboflearning.com


/etc/hosts:
# Do not remove the following line, or various programs
# that require network functionality will fail.
::1 localhost.localdomain localhost weboflearning.com
127.0.0.1 weboflearning weboflearning.com localhost


/etc/sysconfig/network:
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=weboflearning.com


Still, everytime I telnet in, it says localhost no matter what. Maybe I have something configured wrong? Any expert help on the matter would be greatly appreciated, as I'm starting to get pretty frustratd with it. Thanks in advance.

-Ryan

Oops - forgot to mention I'm running CentOS 5.2

Last edited by ryes31; 10-02-2008 at 01:36 PM. Reason: update OS version
 
Old 10-02-2008, 02:05 PM   #2
DotHQ
Member
 
Registered: Mar 2006
Location: Ohio, USA
Distribution: Red Hat, Fedora, Knoppix,
Posts: 548

Rep: Reputation: 33
Assuming you restarted networking after each of these changes.

What do you get if you telnet to yourself from that server?

It appears you've set the hostname in all the right places.

I just did:
[/etc]# telnet dothq.com 25
Trying 205.234.242.36...
Connected to dothq.com.
Escape character is '^]'.
220-vps.dothq.com ESMTP Exim 4.69 #1 Thu, 02 Oct 2008 14:58:14 -0400
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.

I did this from the dothq.com server.
 
Old 10-02-2008, 02:12 PM   #3
ryes31
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Yeah I did restart the network after making each change.
I get the same thing when I telnet to myself from inside the server-

[root@weboflearning /]# telnet weboflearning.com 25
Trying 127.0.0.1...
Connected to weboflearning.com (127.0.0.1).
Escape character is '^]'.
220 localhost SMTP; Thu, 02 Oct 2008 15:04:58 -0500


Still can't figure out why it might be doing this when the hostname is set permanently. It's gotta be some simple fix right in front of my face that I'm going to kick myself for later.
 
Old 10-02-2008, 02:29 PM   #4
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by ryes31 View Post
Still, everytime I telnet in, it says localhost no matter what. Maybe I have something configured wrong? Any expert help on the matter would be greatly appreciated, as I'm starting to get pretty frustratd with it. Thanks in advance.
When I change the hostname, I run
Code:
find /etc -name '*' -exec grep -H localhost '{}' ';'
and change everything manually to the new hostname. But that is because I have had so much trouble changing the hostname on other RedHat variants.
 
Old 10-02-2008, 05:34 PM   #5
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
From whence are you "teleneting in?" Perhaps what you're seeing is the host name of the telenet source, not of the destination. (Note: I haven't used telenet for 20 years, so that's just a guess.)
 
Old 10-02-2008, 07:35 PM   #6
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
What SMTPd are you running? Does it have a "myhostname" configuration? Postfix does.
 
Old 10-02-2008, 07:47 PM   #7
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
What MTA are you telnetting into - postfix or sendmail (or something else)?

What is the output of the hostname command?

FYI, the hostname is set in /etc/sysconfig/network with the line

HOSTNAME=whatever.example.com

Last edited by billymayday; 10-02-2008 at 07:50 PM.
 
Old 12-06-2012, 10:26 AM   #8
chunk3131
LQ Newbie
 
Registered: Dec 2012
Posts: 1

Rep: Reputation: Disabled
If someone happens upon this looking for an answer...

Make sure you have the appropriate line in your /etc/resolv.conf for your domain, this fixed it for me.

search your-domain.whatever

Cheers.
 
Old 12-12-2012, 04:51 PM   #9
pantdk
Member
 
Registered: Oct 2011
Location: New Delhi
Posts: 248
Blog Entries: 3

Rep: Reputation: 17
try this one

echo "weboflearning.com" > /proc/sys/kernel/hostname

& also check the resolv.conf
 
Old 12-12-2012, 08:19 PM   #10
aedurkee
LQ Newbie
 
Registered: Sep 2012
Location: Tonawnada, NY
Distribution: CentOS Redhat ubuntu mint
Posts: 15

Rep: Reputation: Disabled
Telnet is an xinetd or is it the date inetd service, that may need a restart or it could be that the mailer daemon needs a restart. I would that is read at start up by either or both.
 
  


Reply



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
Mandriva 2008 boot stalls on "setting hostname localhost:" on HPdv9700t cmack43 Linux - Laptop and Netbook 0 02-24-2008 07:00 PM
startx fail , error shown "hostname: Unknown host " syseeker Red Hat 4 07-05-2006 11:40 AM
How to change prompt hostname "localhost"? Arodef Fedora 3 08-02-2004 06:45 AM
/var/log/messages contains "localhost" instead of the real hostname allel Linux - Networking 0 07-15-2002 02:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:23 PM.

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