Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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 have fedora2 core installed and I need to change the hostname from localhost.localdomain to another, still maintaining the 127.0.0.1 or the other IP that my network adapter has, but I can I do it???
The last time I've tried this, gdm gave me an error with gnome and it had problem loggin
You need to have localhost.localdomain and localhost pointing to 127.0.0.1. You can also point your hostname there or to another IP on another interface.
But can I have 2 diferentes hostname for 127.0.0.1?
Can I have 1 hostname for 127.0.0.1 and another one diferent hostname on the same machine with a diferent IP number, not another machine, but the same machine?
If so does will fedore continues to login for the localhost.localdomain has it does in this moment?
Originally posted by mikpos But can I have 2 diferentes hostname for 127.0.0.1?
Can I have 1 hostname for 127.0.0.1 and another one diferent hostname on the same machine with a diferent IP number, not another machine, but the same machine?
I guess I don't understand your questions. Host information should be added to /etc/hosts. Look at man hosts for the format. In my /etc/hosts file, I have 127.0.0.1 being pointed to by localhost and a second hostname. What exactly are you wanting to do?
To change the hostname I think u need to edit 2 files. The 1st is etc/hosts , edit it with vim but LEAVE the the localhost.localdomain alone just TAB then add what u want ie if u want the name 2 b redhat9.redhat.com just add the redhat9, save and exit.Then I think its vim /etc/sysconfig/network and change the line that says localhost.... to redhat9.redhat.com save and exit. Then to see the host name change press CTRL D at the prompt(NO GUI) and the host will change, no reboot required.
Originally posted by mikpos But can I have 2 diferentes hostname for 127.0.0.1?
Can I have 1 hostname for 127.0.0.1 and another one diferent hostname on the same machine with a diferent IP number, not another machine, but the same machine?
If so does will fedore continues to login for the localhost.localdomain has it does in this moment?
att
julio
thanks for the other reply
You can do something like:
127.0.01 localhost.localdomain localhost myname
Or you can do:
127.0.0.1 localhost.localdomain localhost
192.168.0.2 myname
The "real" hostname will continute to be whatever is reported by the hostname command, which is initially set by the config files specific to your distro.
I just want to change then name of "localhost" to my nickname to show at log on. Without changing any configuration since I really dont know much about my network config. since I get my IP detected automatically from the LAN.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.