TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:6618] hostname??



> Do you all guys here know how I would like to change the HOSTNAME to any
> names I like.
> in my .bash_profile know I've set HOSTNAME=`hostname` but the system only
> read my hostname as "localhost.localdomain". If I'm setting my hostname
> using this command "hostname Linux" it just appear at that time only but if
> I'm reboot the system it will recognized my system as localhost.localdomain
> after that?? Do you guys have any idea about this??

Hostname information is one thing that has experienced entropy over time..

The main file you're looking for is /etc/HOSTNAME.  It contains one line, with
the part of your computer's name before the first dot.  If your computer is
called ftp.myhostname.com, /etc/HOSTNAME would contain 'ftp'

In the file /etc/resolv.conf, there would be a line like this:

domain myhostname.com

That tells the computer what domain it is in -- all the stuff after the first
dot.

Also, you'd probably want to add a line into your /etc/hosts file that
corresponds to your hostname..  If you have a static IP address, do something
like

1.2.3.4	ftp.myhostname.com

If you don't have a static IP, look for the line that has 'localhost' on it, and
insert your hostname into the list

127.0.0.1 localhost.localdomain localhost

turns into

127.0.0.1 ftp.myhostname.com localhost.localdomain localhost

All of those entries after the IP address are aliases that you can use on your
own computer to reference yourself.  You can also add in entries for friends'
computers or frequently visited sites..

I hope that made sense..
-- 
 _  _  _  _ _  ___    _ _  _  ___ _ _  __   Give your child mental 
/ \/ \(_)| ' // ._\  / - \(_)/ ./| ' /(__   blocks for Christmas. 
\_||_/|_||_|_\\___/  \_-_/|_|\__\|_|_\ __)                            
[ Mike Hicks | http://umn.edu/~hick0088 | mailto:hick0088@tc.umn.edu ]