Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Problems changing hostname< Next Oldest | Next Newest >
csaunier Offline





Group: Members
Posts: 5
Joined: April 2008
Posted: June 06 2008,02:26 QUOTE

I'm not having any luck changing my hostname.  I've read all of the posts I can find on this subject, read the wiki and changed every "box" I can find to "my new name".  Now my computer seems to be called (none) and while booting I noticed a line that said
"sudo unable to lookup (none) via gethostbyname"
(without the quotes).  I'm running a frugal install.
What have I done?
Back to top
Profile PM 
lucky13 Offline





Group: Members
Posts: 1478
Joined: Feb. 2007
Posted: June 06 2008,02:41 QUOTE

What exactly did you do? If you're using frugal grub, just edit your bootcodes so it includes "host=hostname" (whatever hostname you want).

Edit: Look at the wiki page on cheat codes/boot codes. That's also one of the options in F2/F3 when you boot from the CD, fwiw.


--------------
"It felt kind of like having a pitbull terrier on my rear end."
-- meo (copyright(c)2008, all rights reserved)
Back to top
Profile PM WEB 
chaostic Offline





Group: Members
Posts: 328
Joined: Mar. 2005
Posted: June 06 2008,03:34 QUOTE

Quote (csaunier @ June 05 2008,22:26)
I'm not having any luck changing my hostname.  I've read all of the posts I can find on this subject, read the wiki and changed every "box" I can find to "my new name".  Now my computer seems to be called (none) and while booting I noticed a line that said
"sudo unable to lookup (none) via gethostbyname"
(without the quotes).  I'm running a frugal install.
What have I done?

I'm assuming that this is a HD install, or remaster, because the hostname would be set before any dsl-restore things will happen. I will go back to my hd install and check all the places I made the changes. The most obvious ones are using the hostname command, setting the HOSTNAME variable, and the one to fix your SUDO problem, add your hostname to /etc/hosts, on the 127.0.0.1 line:
127.0.0.1     *hostname* localhost
Currently it would be:
127.0.0.1     (none) localhost

The default, without a hostname= bootcode would be
127.0.0.1     box localhost

Mine, on my thinclient, is
127.0.0.1     thinclient box localhost
just incase I forget to set the hostname bootcode, then manually change the hostname, so sudo won't give any errors.

Edit: Didn't see that you were running frugal. Bootcode is best bet, followed by adding the various commands to bootlocal.sh. Even then, your router might latch on to the default "box" hostname before the commands run, so bootcode "hostname="
Back to top
Profile PM 
lucky13 Offline





Group: Members
Posts: 1478
Joined: Feb. 2007
Posted: June 06 2008,08:25 QUOTE

To follow up on chaostic in case this IS a remaster (or HD install even though you wrote frugal), the three files to edit with the hostname are:
/etc/hostname
/etc/hosts
/etc/init.d/knoppix-autoconfig

The first is straightforward since it's only the hostname and nothing else. The second is like chaostic wrote where your hostname is between 127.0.0.1 and localhost. Line 328 of knoppix-autoconfig has hostname. (Edit: if you're not using an editor with line numbering, use whatever search tool it has to find "hostname." That line should be "hostname whateveryouwant" and all three of the lines need to match caps/lower case.)

If you screwed up a remaster or something, you can update your frugal install or replace /KNOPPIX and you should be back to square one as "box" and then you can use the cheatcode, which is a heck of a lot easier than remastering to change one word in three files.

If you're using grub you can edit your menu.lst or hit "e" on the line you use to boot DSL, hit "e" again on the line that has all the cheatcodes (vga, pcmcia, frugal, etc.) and add "host=whateveryouwant" to it.


--------------
"It felt kind of like having a pitbull terrier on my rear end."
-- meo (copyright(c)2008, all rights reserved)
Back to top
Profile PM WEB 
csaunier Offline





Group: Members
Posts: 5
Joined: April 2008
Posted: June 09 2008,01:39 QUOTE

Thanks for all of your replies.  These are all things I have done and I've gone back to double check the files to make sure I did it right.
I think it's time to start over.
Back to top
Profile PM 
4 replies since June 06 2008,02:26 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: Problems changing hostname

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code