LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-23-2005, 11:34 PM   #1
Thaidog
Member
 
Registered: Sep 2002
Location: Hilton Head, SC
Distribution: Gentoo
Posts: 637

Rep: Reputation: 32
Question How do you change your hostname?


I went to my commandline to change my host name with su with cmd: hostname newlocalhostname

This changed it but when I reboot I get my same old localhost hostname... can you tell me what I'm doing wrong?
 
Old 07-24-2005, 12:20 AM   #2
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
try this (as root)

echo "new_host_name" > /etc/hostname
 
Old 07-24-2005, 12:20 AM   #3
Xihuitl
LQ Newbie
 
Registered: May 2004
Posts: 6

Rep: Reputation: 0
Which distro and version are you using? Be sure to check the online docs for that distrobution and it should tell you how to set your hostname, as that is very basic stuff on a linux box (Shouldn't it be manditory??)
 
Old 07-24-2005, 12:43 AM   #4
Thaidog
Member
 
Registered: Sep 2002
Location: Hilton Head, SC
Distribution: Gentoo
Posts: 637

Original Poster
Rep: Reputation: 32
I'm using Turbo Linux 10F
 
Old 07-24-2005, 01:07 AM   #5
aikidoist72
Member
 
Registered: Jan 2005
Location: Australia
Distribution: Slackware Archlinux FreeBSD
Posts: 218

Rep: Reputation: 30
All good suggestions above

As root

Code:
# hostname (new hostname)
cheers
 
Old 07-24-2005, 08:36 PM   #6
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
Quote:
hostname (new hostname)
This change will not stay after a reboot, which is his original problem. On many distros you have to change it in the file /etc/sysconfig/network, so if you have a directory /etc/sysconfig/ already there then thats likely how you have to do it. Add a line to the file 'HOSTNAME=myhostname' (without the quotes).
 
Old 07-24-2005, 08:52 PM   #7
aikidoist72
Member
 
Registered: Jan 2005
Location: Australia
Distribution: Slackware Archlinux FreeBSD
Posts: 218

Rep: Reputation: 30
What does your /etc/hostname file say?
 
  


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
How do you change your Hostname? JGplt3095 Linux - Newbie 2 09-28-2005 02:02 PM
Change hostname garlam Slackware 2 10-13-2004 02:19 AM
How to change hostname blackbart Linux - Newbie 2 02-01-2004 02:56 PM
change hostname dincer80 Linux - Networking 3 07-31-2003 01:30 AM
change hostname kafnir Linux - Networking 1 10-21-2002 11:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:39 AM.

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