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.
Howdy all. When I installed CentOS 4, I don't think I assigned a host name. That beign said, would my host name then be the ip address? But it gets worse....
My ip address has since changed due to dhcp. When I go into the terminal, I am connected as user@ip22-22-22-22(not really all 2's). The address is my new address, not the address I had when I originally installed the OS. So as near as I can tell, the host name was assigned the IP address, and changed when the IP changed. Is that the case?
A hostanme is typically ComputerName.Domain, if you assigned a computername that would be the hostname. When you are connected at a terminal is it showing your internal ip address, or are you talking about ssh from the outside?, just asking because this is what I commonly see. Not too sure about CentOS though. On my Slackware box I have /etc/HOSTNAME, do you have the same?
You assign the hostname, and dhcp assigns the IP **to that name**. DHCP is not going to change your hostname.
When you do assign a hostname, don't make it like an IP--that would have the potential of really confusing the SW--not to mention the operator of the computer. Just name the computer after your favorite pet, girlfriend, etc.
A hostanme is typically ComputerName.Domain, if you assigned a computername that would be the hostname. When you are connected at a terminal is it showing your internal ip address?, just asking because this is what I commonly see. Not too sure about CentOS though.
Sorry, I should have specified this as well. When I log in/ out I see ip.domainName in the lower right corner, which is another reason I suspected it as being the host name. Regardless, I just found out that ipconfig is not universal, and was wondering if there is a way for me to determine my host name?
The complete hostname is name.domain but at least on my system, hostname just gives the name. Perhaps you have told your machine that "name" is really "name.domain"
Look in /etc/hosts and you will see something like this:
127.0.0.1 localhost.localdomain localhost mepis1
These are all aliases for the hostname
Please post the content of your /etc/hosts file
Again, you don't want an IP address for a hostname
Thank you all for your efforts thus far. the only thing in my /etc/hosts file is:
127.0.0.1 localhost.localdomain localhost
Also, I found a GUI Network Config tool, and under Hostname it says "localhost.localdomain".
These two things, plus the fact that I didn't assign a name during install, is leading me to beleive the name is acutally "localhost". Is this correct?
Thank you all for your efforts thus far. the only thing in my /etc/hosts file is:
127.0.0.1 localhost.localdomain localhost
Also, I found a GUI Network Config tool, and under Hostname it says "localhost.localdomain".
These two things, plus the fact that I didn't assign a name during install, is leading me to beleive the name is acutally "localhost". Is this correct?
I think maybe "localhost" is some kind of default. What does the command hostname say?
Actually, that command may be how you CHANGE the hostname---YES!! check man hostname for how to change your hostname at the CLI.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.