Edit /etc/sysconfig/network. You should see an entry for your hostname that will most likely say localhost.localdomain. Just change that. Make sure your LAN DNS is updated so other hosts can resolve to this box by the new name.
Red Hat 6.2.
Here is the hosts file
127.0.0.1 wsense localhost.localdomain localhost
I need this workstation to be a part of internal bel.com domain.Ip address of that machine is 10.0.20.3.
How should I change my hosts file.
Edit /etc/sysconfig/network. You should see an entry for your hostname that will most likely say localhost.localdomain. Just change that. Make sure your LAN DNS is updated so other hosts can resolve to this box by the new name.
Well to add more hosts to your little DNS file (useful for pinging sparebox.you.net instead of ping 1.2.3.4) just edit /etc/hostsRed Hat 6.2.
Here is the hosts file
127.0.0.1 * * * * * * * wsense localhost.localdomain localhost
I need this workstation to be a part of internal bel.com domain.Ip address of that machine is 10.0.20.3.
How should I change my hosts file.
and add a line for each PC that is on your LAN in the following fashion.
IP {tab} hostnames
IP {tab} hsotnames
Add one for each PC in you LAN. Restart your PC ( I may be wrong but bringing down you network stack is necessary to reload that stuff, and can only be accompished by going to runlevel 0/1 to runlevel3/5)
You should once you get back up, be able to ping your boxes by going ping name.of.your.box.
Any Q's feeel free to ask !
If this box is on a LAN running a full DNS implementation, I wouldn't even bother with /etc/hosts, other than to add your own hostname to the lookback (127.0.0.1) line. Upkeeping a hosts file is just too much work if you have a nameserver already running.
Well to add more hosts to your little DNS file (useful for pinging sparebox.you.net instead of ping 1.2.3.4) just edit /etc/hosts
and add a line for each PC that is on your LAN in the following fashion.
IP {tab} hostnames
IP {tab} hsotnames
Still not clear about a couple of things:
This is my sysconfig/network file:
NETWORKING=yes
HOSTNAME=wsense
GATEWAY=10.0.82.3
Should I change wsense to wsense.bel.com? Will it be somehow reflected in hosts file (automatically)? Or should I change hosts file as well?
All I want to do is to join this box to existing domain, (You know, like on windoxe box going to tcp/ip properties and specifying domain name...)
1) Put your FQDN in your /etc/sysconfig/networks, meaning wsense.bel.com. I don't know if you need the whole FQDN or just the host name, but putting the whole thing in there won't hurt. This file tells your box what its name is.Still not clear about a couple of things:
This is my sysconfig/network file:
NETWORKING=yes
HOSTNAME=wsense
GATEWAY=10.0.82.3
Should I change wsense to wsense.bel.com? Will it be somehow reflected in hosts file (automatically)? Or should I change hosts file as well?
All I want to do is to join this box to existing domain, (You know, like on windoxe box going to tcp/ip properties and specifying domain name...)
2) /etc/hosts is just a fail over, or replacement for DNS. Actually it's really the great grandfather of DNS. If you are on a domain, you will only need the hostname in the loopback portion (127.0.0.1).
3) Add the appropriate A and PTR records on your name server for this host.
That should be it, unless of course you want to be able to browse WIndoze boxes with this box, or allow it to browze the NT domain. For that you will need samba.
I would tend to agree if there were more than a handful. NIS does that much better, and can be much more quickly implemented on a larger scale. But for small LAN's, it isnt that difficult anyhow. Plus it makes life that much easier. Typing 123.123.123.123 each time BOB needs to be accessed can be time consuming.
If this box is on a LAN running a full DNS implementation, I wouldn't even bother with /etc/hosts, other than to add your own hostname to the lookback (127.0.0.1) line. Upkeeping a hosts file is just too much work if you have a nameserver already running.
As for changing HIS hostname (I missed that apparently), your file in questin for RedHat and SuSE is /etc/network . Mine looks like this
That is all you really need to get going with a new hostname. IIRC, on some distros the command hostname will work too. Slackware IIRC does it that way.Code:NETWORKING=yes HOSTNAME=wildturkey.schotty.net GATEWAY=1.1.0.1
Bookmarks