Which config file do I set the hostname in (RH9)?
I have RH9. I used the Network Configuration dialog to change the hostname from localhost to <newlocalhost>. It works, but now my computer boots *really* slowly--it gets to "starting sendmail" and takes about ten minutes, and then gets to "starting sm-client" and takes another ten minutes, and then there's another long pause just before it draws the login screen, and when I open any sort of window it too takes forever to load.
I'm assuming there's a config file or two that I need to change? /etc/hosts perhaps? And what do I put in it? Thanks, anachron |
To set the hostname permanently, edit these files:
/etc/sysconfig/network by adding HOSTNAME=Your-host-name Sometimes its best to add the full hostname plus domain there, example: HOSTNAME=myhost.mydomain.com /etc/sysconfig/network-scripts/ifcfg-eth0 and change your default hostname there. At a prompt do this as root: hostname your-host-name And then restart your network with this command as root once again: /sbin/service network restart In your /etc/hosts file you will want to make sure you have your loopback address along with your actual hostname like this example: 127.0.0.1 loopback X.X.X.X your-hostname.yourdomain.com your-hostname Where X.X.X.X is the actual IP of your machine, etc. If it still starts up slowly, could be other problems but I'd try that first. |
If my computer isn't on any network, what should I put in /etc/hosts as my IP address? Do I skip the loopback line?
Thanks, anachron |
Below are a couple of man pages that should help you out. Leave the loopback line in the hosts file alone. It is used by some applications during normal operation. Therefore, you always have to configure it, regardless of whether your machine is attached to a network or not.
man hostname man hosts Bill |
Quote:
|
I gather that PC1 and PC2 are part of your own local network. What I've done is make entries for each PC in each /etc/hosts on all machines in the network. Haven't had any problems since then. I added them to the hosts file on my WINNT box as well. Each machine has no problem connecting to another using the alias or ip address. Here is a sample very much like what is on the hosts man page.
127.0.0.1 localhost.localdomain localhost 192.168.1.3 fred.flintstones.org fred 192.168.1.7 wilma.flintstones.org wilma 192.168.1.8 barney.flintstones.org barney Bill |
Quote:
|
Yes, this is a quick way of letting each computer in your local network know what and where the others are at. An alternative would be to set up a DNS, but that is another story.
Bill |
Normaly, DNS would be in charge of resolving name. When I change hostname/ip,how could I notify DNS and make it aware of the changes?Should I install a DNS client here?
my /etc/resolv.conf is: nameserver 192.168.56.6 nameserver 192.168.56.7 |
All times are GMT -5. The time now is 11:10 AM. |