Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
SpaceferretOffline
Post subject: [solved]hostname  PostPosted: 21.10.2011, 03:30



Joined: 2010-09-13
Posts: 97

Status: Offline
I just recently noticed that my computer's hostname is not the one assigned when I first installed aptosid. The content of etc/hostname contains the right one, but # hostname shows an alphanumeric string.
I can change it using /etc/init.d/hostname.sh script but it changes back after reboot . Any ideas ?


Last edited by Spaceferret on 28.10.2011, 23:41; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
slamOffline
Post subject: RE: hostname  PostPosted: 21.10.2011, 06:37
Team Member


Joined: 1970-01-01
Posts: 607
Location: w3
Status: Offline
To change your hostname, don't touch the init script! Simply use:
      Code:
echo myname > /etc/hostname && echo myname > /etc/mailname && hostname --file /etc/hostname
No need to reboot, by the way.
Greetings,
Chris

_________________
an operating system must operate
development is life
my Debian repo
 
 View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number 
Reply with quote Back to top
bfreeOffline
Post subject: RE: hostname  PostPosted: 21.10.2011, 11:02
Team Member


Joined: 2010-08-26
Posts: 253

Status: Offline
I think this is actually a problem of the dhcp-server giving the name and the system then accepting it. Can't remember where you disable that behaviour but I'm pretty sure there's a thread on it somewhere here in the forum.
 
 View user's profile Send private message  
Reply with quote Back to top
SpaceferretOffline
Post subject: RE: hostname  PostPosted: 21.10.2011, 12:48



Joined: 2010-09-13
Posts: 97

Status: Offline
Thank you Chris, I'll try that,I'm not 100% sure that will work because it seems like after reboot /etc/hostname file is being ignored.
 
 View user's profile Send private message  
Reply with quote Back to top
SpaceferretOffline
Post subject: RE: hostname  PostPosted: 24.10.2011, 13:02



Joined: 2010-09-13
Posts: 97

Status: Offline
After reboot etc/hostname file remains unchanged, but the system shows something completely different.So, it doesn't work.
 
 View user's profile Send private message  
Reply with quote Back to top
hubiOffline
Post subject: RE: hostname  PostPosted: 24.10.2011, 13:35
Moderator


Joined: 2010-09-11
Posts: 228
Location: Vienna (AT)
Status: Offline
That should not happen. Why should the hostname change? Have a look into /etc/hosts if you have a different hostname assigned in a line starting with "127.0.0.1".

hubi

_________________
Tilos Rádió Budapest
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
wofritzOffline
Post subject: RE: hostname  PostPosted: 24.10.2011, 13:56



Joined: 2010-09-11
Posts: 30
Location: Uetze/NDS/DE
Status: Offline
Is it possible that DHCP changes your hostname?
 
 View user's profile Send private message  
Reply with quote Back to top
SpaceferretOffline
Post subject: RE: hostname  PostPosted: 26.10.2011, 23:40



Joined: 2010-09-13
Posts: 97

Status: Offline
In my etc/hosts file I have 2 lines starting with 127.0.0.1
The first one is 127.0.0.1 > localhost
The second one is 127.0.0.1> eternity
the second line is the correct hostname I would like to use, but that is not what I'm getting, I'm getting an alphanumeric string
 
 View user's profile Send private message  
Reply with quote Back to top
gerdOffline
Post subject: RE: hostname  PostPosted: 27.10.2011, 05:27



Joined: 2010-09-13
Posts: 94

Status: Offline
"127.0.0.1> eternity" ?
it should be
"127.0.0.1 eternity"
 
 View user's profile Send private message  
Reply with quote Back to top
hubiOffline
Post subject: RE: hostname  PostPosted: 27.10.2011, 20:29
Moderator


Joined: 2010-09-11
Posts: 228
Location: Vienna (AT)
Status: Offline
I second gerd. My hostname is sidasus and /etc/hosts reads:
      Code:
127.0.0.1       sidasus localhost.localdomain   localhost
Same on another laptop in my network with the hostname tosh:
      Code:
127.0.0.1       localhost tosh
No problems at all, but I tend to write network setups in a very old skool way - manually, not using helper applications.

hubi

_________________
Tilos Rádió Budapest
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
SpaceferretOffline
Post subject: RE: hostname  PostPosted: 28.10.2011, 00:37



Joined: 2010-09-13
Posts: 97

Status: Offline
Obviously this is not something that affects my system performance , but it boggles my mind as I would like to find out why in etc/hosts the hostname is eternity but $hostname gives something totally different
      Code:
127.0.0.1   localhost   eternity
spaceferret@S01060018f39aefc6:~$ hostname
S01060018f39aefc6

I've tried every trick in the book to change the hostname but after reboot it appears changed again
 
 View user's profile Send private message  
Reply with quote Back to top
wofritzOffline
Post subject: RE: hostname  PostPosted: 28.10.2011, 05:45



Joined: 2010-09-11
Posts: 30
Location: Uetze/NDS/DE
Status: Offline
I ask again: Do you get your IP address etc. from a router or something via DHCP? DHCP can set the host name - all PCs in my company get their hostname via DHCP.

This host name: S01060018f39aefc6 might contain your interface's MAC address: 00:18:f3:9a:ef:c6, at least it has a valid vendor ID: 00:18:f3 = ASUSTek COMPUTER INC. This could be an indication that it is an artificial host name created by a router.

Try to boot the PC without any net connection and check if the hostname is still wrong.

EDIT: You are not the first with this problem: I entered S010600 in Google and found this:
http://www.linuxquestions.org/questions ... ng-182579/

Regards,
Wolfgang
 
 View user's profile Send private message  
Reply with quote Back to top
slhOffline
Post subject: RE: hostname  PostPosted: 28.10.2011, 10:22



Joined: 2010-08-25
Posts: 731

Status: Offline
Remove the "host-name" parameter from the "request" stanza in /etc/dhcp/dhclient.conf, isc-dhcp-client uses a braindead default of requesting (and overriding) the hostname as part of its dhcp request, to which the dhcp server (router) quite often returns stale information or utter garbage; see #643771.
 
 View user's profile Send private message  
Reply with quote Back to top
SpaceferretOffline
Post subject: RE: hostname  PostPosted: 28.10.2011, 23:48



Joined: 2010-09-13
Posts: 97

Status: Offline
Thank you Stefen , it did the trick,no more weird numbers.I think I should change my wallpaper http://opendesktop.org/content/show.php/aptosid+-+slh?content=139447
 
 View user's profile Send private message  
Reply with quote Back to top
SpaceferretOffline
Post subject: RE: hostname  PostPosted: 29.10.2011, 00:38



Joined: 2010-09-13
Posts: 97

Status: Offline
Inspired by Stefen's knowledgeable advice, I'm going to push my luck a little bit further Smile and ask for some piece of information to help me to resolve the 'notorious' hibernate problem. When I put my comp in hibernate mode it will save the session but the power will stay on. Holding the power button for a few seconds will turn power off,on restart session is restored and I'm presented with screensaver and user login prompt.Perhaps, some configuration mistakes on my part ?
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by Zafenio