LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to change hostname???? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-change-hostname-796079/)

t1nm@n 03-17-2010 01:17 PM

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

smoker 03-17-2010 01:20 PM

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

sd|| 03-17-2010 01:44 PM

a proper procedure to change/add h0stname:

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

i hope this could help you! :)

t1nm@n 03-17-2010 02:02 PM

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.

kopper27 03-17-2010 04:01 PM

this is also a way to change hostname without rebooting

Code:

#sysctl kernel.hostname=newhostname

t1nm@n 03-17-2010 09:24 PM

thanks kopper.


All times are GMT -5. The time now is 04:12 AM.