| Author |
Message |
Spaceferret
|
|
Post subject: [solved]hostname
Posted: 21.10.2011, 03:30
|
|

Joined: 2010-09-13
Posts: 96
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
|
| |
|
|
|
 |
slam
|
|
Post subject: RE: hostname
Posted: 21.10.2011, 06:37
|
|
Team Member

Joined: 1970-01-01
Posts: 606
Location: w3
Status: Offline
|
|
|
|
|
 |
bfree
|
|
Post subject: RE: hostname
Posted: 21.10.2011, 11:02
|
|
Team Member

Joined: 2010-08-26
Posts: 225
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. |
|
|
| |
|
|
|
 |
Spaceferret
|
|
Post subject: RE: hostname
Posted: 21.10.2011, 12:48
|
|

Joined: 2010-09-13
Posts: 96
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. |
|
|
| |
|
|
|
 |
Spaceferret
|
|
Post subject: RE: hostname
Posted: 24.10.2011, 13:02
|
|

Joined: 2010-09-13
Posts: 96
Status: Offline
|
|
| After reboot etc/hostname file remains unchanged, but the system shows something completely different.So, it doesn't work. |
|
|
| |
|
|
|
 |
hubi
|
|
Post subject: RE: hostname
Posted: 24.10.2011, 13:35
|
|
Moderator

Joined: 2010-09-11
Posts: 220
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
|
| |
|
|
|
 |
wofritz
|
|
Post subject: RE: hostname
Posted: 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? |
|
|
| |
|
|
|
 |
Spaceferret
|
|
Post subject: RE: hostname
Posted: 26.10.2011, 23:40
|
|

Joined: 2010-09-13
Posts: 96
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 |
|
|
| |
|
|
|
 |
gerd
|
|
Post subject: RE: hostname
Posted: 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" |
|
|
| |
|
|
|
 |
hubi
|
|
Post subject: RE: hostname
Posted: 27.10.2011, 20:29
|
|
Moderator

Joined: 2010-09-11
Posts: 220
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
|
| |
|
|
|
 |
Spaceferret
|
|
Post subject: RE: hostname
Posted: 28.10.2011, 00:37
|
|

Joined: 2010-09-13
Posts: 96
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 |
|
|
| |
|
|
|
 |
wofritz
|
|
Post subject: RE: hostname
Posted: 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 |
|
|
| |
|
|
|
 |
slh
|
|
Post subject: RE: hostname
Posted: 28.10.2011, 10:22
|
|

Joined: 2010-08-25
Posts: 585
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. |
|
|
| |
|
|
|
 |
Spaceferret
|
|
Post subject: RE: hostname
Posted: 28.10.2011, 23:48
|
|

Joined: 2010-09-13
Posts: 96
Status: Offline
|
|
|
|
|
 |
Spaceferret
|
|
Post subject: RE: hostname
Posted: 29.10.2011, 00:38
|
|

Joined: 2010-09-13
Posts: 96
Status: Offline
|
|
Inspired by Stefen's knowledgeable advice, I'm going to push my luck a little bit further 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 ? |
|
|
| |
|
|
|
 |
|
|