1834431 Members
2093 Online
110067 Solutions
New Discussion

Re: modify /etc/hosts ?

 
SOLVED
Go to solution
rodh_z
Advisor

modify /etc/hosts ?

I added entries in /etc/hosts, how can take affect that without server reboot ?

hostname ?
IP address ?
xx.com (dns) ?

Any command to re-active that ?

Thnks,
Rodh_z
7 REPLIES 7
James R. Ferguson
Acclaimed Contributor

Re: modify /etc/hosts ?

Hi:

If you are changing *your* server's hostname or IP address, then you should run '/sbin/set_parms' to affect this. A reboot will ocurr but the change will be clean.

If you are merely adding another server's information then there is nothing you need to do after adding or changing the information.

If you are changing *your* DNS server's IPaddress, then modify '/etc/resolv.conf'. The change will be available without reboot.

Regards!

...JRF...

rodh_z
Advisor

Re: modify /etc/hosts ?

For the use of website
nothing do u after adding ? right.

[root@
# more /etc/hosts |grep *.mnl.com
180.33.122.210 net.mnl.com
180.33.122.200 rp.mnl.com
James R. Ferguson
Acclaimed Contributor
Solution

Re: modify /etc/hosts ?

Hi (again):

Correct.

Regards!

...JRF...
rodh_z
Advisor

Re: modify /etc/hosts ?

wht do u ,mean ? "A reboot will ocurr but the change will be clean." when using the set_parms. It will back to its original config?

thnks ...JRF...
James R. Ferguson
Acclaimed Contributor

Re: modify /etc/hosts ?

Hi (again):

If you want to change a server's hostname or its IP address, an easy way to do this is to run '/sbin/set_parms'. If you execute this without any parameters you will see the options that you have.

The 'set_parms' script is a question-and-answer program. It is a "clean" way to change a hostname, ipaddress, etc. because all the necessary configuration files are updated for you.

Changing a hostname requires a reboot afterwards. 'set_parms" accomplishes this. Changing a host's own ipaddress requires at least that the networking daemons be stopped and restarted. It is easiest to use 'set_parms" and let it reboot too.

Regards!

...JRF...
Chauhan Amit
Respected Contributor

Re: modify /etc/hosts ?

Hi Rodh,
You don't need to do anything after adding the entries in "/etc/hosts" . Changes will immediately effective.
What James is trying to explain you is the method for changing the hostname of the server.

-Amit
If you are not a part of solution , then you are a part of problem
Muthukumar_5
Honored Contributor

Re: modify /etc/hosts ?

Adding entries in /etc/hosts will not need any reboot. If you want to change your machin'e hostname, ip-address and domain using set_parms will require reboot for making that configuration.

To check /etc/hosts working efficiency then,

# ping

--
Muthu
Easy to suggest when don't know about the problem!