Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
I changed my hostname from localhost to a different name by accident when I was playing the network configuration using X Window. Now I don't know how to change it back to localhost. I can change at command line by typing "hostname localhost". But next time I start my comupter it goes back to that name I created. What do I do to change it permanently? I have only one line in my /etc/hosts file, which is "127.0.0.1 localhost.localdomain localhost". Thanks.
Assigning localhost as a hostname is just a default. localhost resolves to the the local loopback interface i.e. 127.0.0.1 on every TCP/IP configured PC. IMO you do not want to keep the hostname as localhost.
However, you can change the hostname by editing the /etc/sysconfig/network file.
Michaelk was right. I modified /etc/sysconfig/network file and the hostname is changed. If you can see this post, can you tell me why I don't want to keep localhost as the host name? Thanks.
its ur pick, hostname is basicaly the naem of your computer, so call it whatever u want, if you want to call it localhost then u can call it that, call it whatever you want, whatever makes u happy (i wonder if anyone ever changed there hsotname to a girls name and put a picture of her as teh background in x, that would be weird)
Why would that be weird? It sounds OK to me. I didn't want to change my hostname 'cause if i change that I got to change a lot of other things. Otherwise the system won't work right. It will give me error messages, or mysql server won't start. Maybe all of this is because I'm new and don't really understand the system.
Originally posted by oldoldcat Why would that be weird? It sounds OK to me. I didn't want to change my hostname 'cause if i change that I got to change a lot of other things. Otherwise the system won't work right. It will give me error messages, or mysql server won't start. Maybe all of this is because I'm new and don't really understand the system.
I don't know either. Mine used to be my daughter's name, and I used her picture for wallpaper often. I just changed from Mandrake to Debian, and now I call the local host "golem" (from an old silent movie). I am not sure how many have fixed local host names, but most of the stuff I use look for the current host name...
What affect does changing your hostname once your have setup and configured your system under another? Will applications simply adapt to the new hostname?
I would think most applications would use the $HOST variable instead of a specific hostname. I'm not certain of this, but I don't see why they wouldn't...this way any application that needs to use your hostname can just call the variable and it'll get whatever you've set as $HOST
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.