Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi , i want to permanently change my machine's name as linuxQube or something like that.. the hostname command onyl sets it for the current session ..when i reebot i get localhost.localdomain. I run apache, tomcat etc etc.. will chnaging m hostname affect those services ?? how can i do it "safe" ???
I got so frustrated not being able to change the host name permanently, that I finally did a "slocate localhost" and then visited all the files that appeared to play a role in keeping my computer so stupidly named, and changed every instance (about four, as it turned out) to the name I wanted.
Result: name permanently changed. HOWEVER, I am not on a network, just a lone desktop with Internet access. So I would not advise this approach for anybody with a more complex setup. It could indeed be asking for trouble.
EDITED: Oops, sorry, what I did was look for the string "localhost" inside all files, using Midnight Commander's search function. Slocate would not give that information.
If u see /etc/rc.sysinit file, /etc/sysconfig/network file is sourced to set the hostname and then the value of /bin/hostname is read. So if you set the hostname in /etc/sysconfig/network you should be ok.
I think you should also set the ServerName in httpd.conf or think it reverts to localhost.
Originally posted by Aussie The command to set or change the system hostname is 'hostname'.
Do 'man hostname' to read the unix manual page for the hostname command.
That works for changing the hostname during the session you're in, but on the next reboot, the hostname reverts to the old one. At least in the distribution I use! The question here was how to permanently change the hostname.
As I told before, you have to set it in /etc/sysconfig/network. Or a hack - do hostname -v <HOSTNAME> in /etc/rc.d/rc.local file. Instead of manually setting for that boot session this does it automatically.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.