LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-12-2010, 11:34 PM   #1
micka
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Rep: Reputation: 0
HOSTNAME shows as none from terminal


Hi All,

I had always worked fine with my Red hat 4.0 untill yesterday night when i logged in i had an error saying: "HOSTNAME could not be found, you can resolve this by editing the /etc/hosts"

eventually it logged me in but when i launch the terminal ...i now see 'username@(none)dir' .

In other words my HOSTNAME shows as 'none'.

I looked into /etc/hosts file but everything looks the same, which for is:

127.0.0.1 mluboya

When i look into network configuration, my host is well: mluboya

Could someone please help !!!

Thank you
 
Old 02-13-2010, 07:45 AM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
Have you tried setting the hostname ?
As root :
hostname your_host_name

This is temporary until a reboot, you need it in the /etc/hosts file too.

Also, a hostname is usually like host.domain.tld
I don't know if a single word will work.
Even the default is localhost.localdomain

regards

Alan
 
Old 02-13-2010, 11:09 AM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Your host name is stored in the file /etc/hostname not /etc/hosts

You need to find out how this change to your system happened... Have you been compromised?
 
Old 02-13-2010, 01:55 PM   #4
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
Note that hostname doesn’t change anything permanently.
After reboot original names from /etc/hosts are used again.

From man hostname fedora 12

There are several places it needs setting, but they can all be done from GUI components.
I pointed out in your other post that you have probably been rooted.
 
Old 02-14-2010, 12:07 AM   #5
micka
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Original Poster
Rep: Reputation: 0
HOSTNAME shows as none from terminal

Thanks All for replies:

currently im unable to login as normal user, so i logged in as Root and tried to change /etc/hosts with following contents:

127.0.0.1 localhost.localdomain

i also change the hostname with:

hostname localhost.localdomain

The changes have been made but when i reboot, HOSTNAME on my terminal still shows as NONE

when i looked into the /var/log/messages, i think the problem lies with these errors i found:

ifup: Missing config file ifcfg
network: bringing up loopback interface: FAILED


my ethernet card is fine cause i use dual boot on this laptop and on windows ethernet is ok.

Please, do you know how can we go about it ?

Thanks
 
Old 02-14-2010, 12:50 AM   #6
camphor
Member
 
Registered: Jan 2009
Location: USA
Distribution: Fedora 14 / Slackware 13.1
Posts: 85

Rep: Reputation: 20
Make sure there is a hostname set in /etc/HOSTNAME (case sensitive).

Also, make this line in /etc/hosts:

Quote:
Originally Posted by micka View Post
127.0.0.1 localhost.localdomain
into this line:

Quote:
127.0.0.1 localhost.localdomain localhost

Last edited by camphor; 02-14-2010 at 12:51 AM.
 
Old 02-14-2010, 11:35 PM   #7
micka
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Original Poster
Rep: Reputation: 0
HOSTNAME shows as none from terminal

Hi camphor,

Thanks for the reply... i did what you said but still same error.

i first more /etc/HOSTNAME but its not there so i vi it and filled it with: 127.0.0.1 localhost.localdomain localhost

i did the same with /etc/hosts.

But still same error ...
 
Old 02-19-2010, 12:36 PM   #8
micka
LQ Newbie
 
Registered: Feb 2010
Posts: 5

Original Poster
Rep: Reputation: 0
HOSTNAME shows as none from terminal

Any ideals guys..???

Please help ...
 
Old 02-19-2010, 01:55 PM   #9
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
Have you checked your system out yet ? Your external USB drive stopped connecting and your hostname (and ifcfg) have disappeared. Things like that just don't happen.
Get a live cd and run virus checks and rootkit checks before you go any further.
I suggest INSERT
http://www.inside-security.de/insert_en.html
Use chkrootkit to see if your files have been rooted.
 
  


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
the terminal shows -bash-3.2 tapan_chugh Linux From Scratch 10 10-19-2013 10:18 AM
who -T !!! NOTE: It shows who(individual id) is using what group id in which terminal JATA01 Linux - Enterprise 2 10-14-2008 09:42 AM
What code in the terminal shows you the list of sockets? JBailey742 Linux - General 3 02-20-2008 09:16 PM
Cannot Get into X11 as well as to terminal--Some Space error it shows covaigold Linux - Software 0 02-19-2005 09:24 AM
is there a terminal command that shows how much space is left in my partitions lemuel Linux - Newbie 3 01-23-2005 07:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:50 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