LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-17-2010, 01:17 PM   #1
t1nm@n
Member
 
Registered: Aug 2009
Location: Trivandrum, Kerala, India.
Distribution: Slackware 14.2 x86_64
Posts: 96
Blog Entries: 3

Rep: Reputation: 25
How to change hostname????


inorder to change host name i usually create a file with this:

nano /etc/hostname (after going SU)

and in that i type the new hostname.
also i did this too...

nano /etc/hosts

127.0.0.1 localhost <hostname>

nothing happens.

os is PCLinux
 
Old 03-17-2010, 01:20 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 250Reputation: 250Reputation: 250
what is the result of running
hostname

If it shows the hostname you've done it, if not do
hostname my.hostname.com

And /etc/hosts should not be like that, put your hostname on a separate line
Code:
127.0.0.1    my.hostname.com
I have my hostname pointed at my network address
Code:
192.168.1.65    my.hostname.com

Last edited by smoker; 03-17-2010 at 01:24 PM.
 
Old 03-17-2010, 01:44 PM   #3
sd||
Member
 
Registered: Oct 2009
Distribution: Arch Linux
Posts: 89

Rep: Reputation: 18
a proper procedure to change/add h0stname:

http://www.scriptinstallation.in/lin..._hostname.html

i hope this could help you!
 
Old 03-17-2010, 02:02 PM   #4
t1nm@n
Member
 
Registered: Aug 2009
Location: Trivandrum, Kerala, India.
Distribution: Slackware 14.2 x86_64
Posts: 96

Original Poster
Blog Entries: 3

Rep: Reputation: 25
i did it guys thanks a lot sdll thanks for the html. smoker i took to the hostname coomand what i did was i used this command as root

hostname -v -F /etc/hostname

and then executed network restart from /etc/xinit.d

and this time it worked. thanks with ur posts i know now ho to change my hostname.

tinman.
 
Old 03-17-2010, 04:01 PM   #5
kopper27
Member
 
Registered: Nov 2009
Posts: 147

Rep: Reputation: 16
this is also a way to change hostname without rebooting

Code:
#sysctl kernel.hostname=newhostname
 
Old 03-17-2010, 09:24 PM   #6
t1nm@n
Member
 
Registered: Aug 2009
Location: Trivandrum, Kerala, India.
Distribution: Slackware 14.2 x86_64
Posts: 96

Original Poster
Blog Entries: 3

Rep: Reputation: 25
thanks kopper.
 
  


Reply

Tags
hostname



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
after hostname change, syslogd still output previous hostname to messages file tiger2000 Linux - General 3 07-22-2009 09:36 PM
Cannot change hostname chriseacrett Linux - Networking 6 01-11-2008 11:28 PM
cant change hostname! secret_squirrel SUSE / openSUSE 3 04-18-2005 10:30 PM
Change HOSTNAME Belize Slackware 8 01-04-2005 03:42 PM
change hostname mikpos Linux - Networking 1 08-12-2004 12:19 PM

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

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