Changing HOSTNAME in mandriva 2009
I have tried changing my hostname which currently is "localhost" to "myBOX" without success; I have tried editing some of the files advised on this site and others without success, any help will be appreciated.
The changes I made so far were vi /etc/sysconfig/network #I added the line HOSTNAME = myBox Rebooted the machine, no change, i did the same thing as advised on another site with the files /etc/sysconfig/network-scripts/ifcfg-eth0 and /etc/sysconfig/network-scripts/ifcfg-wlan0 still no change after rebooting, I still have "[myname@localhost]$ " on my command prompt :( |
Try following this guide..
http://linux-journal.blogspot.com/20...host-name.html Should get you sorted just fine,. |
Thanks, I followed the direction in the guide, but I am still a bit confused; I rebooted the machine and it still shows my hostname as "localhost" on the terminal, and when I type "$hostane" or "$uname -n" on the terminal I get printed "localhost", however I get the desired result with "$hostname -f" and "$hostname -s".
Any idea on why this is happening??? |
enter this as root
Quote:
Quote:
now you check it Quote:
Quote:
JKZfixme |
I tried the above, with no succses; this is what /etc/hosts looks like:
# generated by drakhosts #127.0.0.1 drivaBOX.YANHOME localhost.localdomain localhost 192.168.1.8 YANHOME drivaBOX ps: I also tried with the 2nd line uncommented, same result. and this is a copy of /etc/sysconfig/network NETWORKING=yes HOSTNAME = "drivaBOX.YANHOME" DHCP_HOSTNAME = "drivaBOX.YANHOME" I also would like to add that here the hostname is drivaBOX and the localdomain is YANHOME. |
If you did all 6 steps in that document I posted I would be really surprised if it did not work.
Are you sure you didn't skip any steps at all ? Following that entire guide, you would not need to reboot for the new hostname to be active. the /proc/sys/kernel/hostname step will make the final change on the fly. |
As far as I can see I did not miss a single step, below is a copy of the edited files you mention in the tutorial, I hope you can make sense of it. There is something however I am not to sure about is what you mean by receiving the IP from a DHCP server, on my wlan comfiguration it is mean to be getting the ip automatically. it is not a manual configuration.
Code:
[root@localhost yanick]# uname -n |
Quote:
|
It should survive a reboot without any trouble.
Glad you got it all sorted out. |
Unfortunately, the settings do not survive a reboot, the only way I get it to work, is by following the steps, then after I have to log out and log back in to get the desired result. What I realise was after a reboot, i have to go into the terminal and issue the command
Code:
#hostname drivaBOX.YANHOME The first fragment is where I am a lil bit confused as to what to enter. I am connected to the internet through a wireless router, and every computers in the house have their IP automatically assigned. Code:
/etc/hosts Code:
|
When you say everything is gone do you mean all the files you changed reverted back to their previous settings ? That certainly shouldn't happen, unless dhcp is overwriting the changes..
Mandriva Docs.. http://wiki.mandriva.com/en/Docs/Sys...m.27s_Hostname Quote:
|
No I dont meant the files are being reverted to the original, I mean the hostname gets changed back to localhost. And I can only set it to drivaBOX by issuing the command "$hostname drivaBOX.YANHOME", then logging out and logging back in again. But if I restart the laptop, I am back to "localhost" at the prompt. I am connection to my router using wifi, I therefore edited the
/etc/sysconfig/network-scripts/ifcfg-wlan0 as follow: Code:
/etc/sysconfig/newtwork-scripts/ifcfg-eth0 Code:
DEVICE=eth0 |
Either that or assign your box a static IP address..
I'm rather stumped, it appears you have applied all the workarounds recommended, and those from the Mandriva docs, yet it's not sticking.. Does your router have the ability to hand out hostnames as part of the DHCP offer ? if so you could make a reservation for your NIC, so you would always get the same IP and hostmname via dhcp.. |
If you mean can I assign static IP to machines on my network, yes I can, I tried it before with my windows machine, and it works fine, I just choose to leave them to automatic because it is less settings for me to configure... Every time I used this machine to connect at home I get the assigned ip 192.168.1.8
I tried a debian and slack install once, and they both allowed me to choose the hostname during set up, maybe Mdriva should do the same... |
All times are GMT -5. The time now is 09:00 AM. |