Linux - DistributionsThis forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on...
Note: An (*) indicates there is no official participation from that distribution here at LQ.
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 have two machines running Red Hat 9.0 and both of them are called localhost. Since I'd like to have them connect over my wireless network, I figure I should change their names so they are different. But if I change the computer hostname in the Network Configuration applet, DNS tab, my Gnome gives me a weird error message when it starts up and things don't work or work poorly. Wish I wrote down that error message....
Some thing about the etc/hosts file, that prevents programs that need to access the system via a network link from doing so, making most gnome programs die a gnarly death.
So ... how does one go about changing the computer's name?
/etc/hostname is where you put the name of a computer. You can edit this file with a text editor but you will have to be root to do so. Localhost should always be a reference to the localmachine regardless of what machine you are on. It should point to 127.0.0.1 which is the lo or local loopback networking device so services running local have something to bind to for connections.
Great - thanks!
Sorry I'm so dense, but can you give me an example of what exactly this file should look like?
Last time I tried to edit that file it was hard to return to a safe and working state.
Let's say I wanted my computer to be called Fred. What would a working hostname file look like?
Yeah same here. I nearly messed up my system trying to set the hostname as described in man hostname. hehe
I run PCLinuxOS and have configured my hostname in etc/hosts and it appears there just as I want.. but when I start up the console it still says @alopa while before upgrading my system I managed to get it to work like that.. but now for some reason it won change the hostame for me
The GUI tool system-config-network (I think) is what I usually use on RH systems.
On my FC2 system, I don't seem to have the /etc/hostname file. The closest match is /etc/hosts. Here's my copy, if it helps. It does seem a little crummy though.
Code:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain gwdesktop localhost
127.0.0.1 gwdesktop
Just login as root. Open a console and type hostname -v whateverhostname| -F /etc/hosts
and it will change the hostname in whateverhostname. Not sure if the | -F /etc/hosts command is really necessary. It might work by just typing hostame -v whateverhostname.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.