How to configure Hosts file in Linux machines

Q: How to add an entry to hosts file in Redhat/ Fedora/ CentOS?

Hosts files are used to map hostnames to ipaddress. This method is used in networks without having a Domain Name server.

In most linux operating systems "hosts" file can be found in /etc/ directory.
[root@server ~#]vi /etc/hosts   webserver                (Add a hostname entry for system 
#(save the hosts file)

[root@server ~#]ping webserver
64 bytes from  webserver  ( ): icmp_seq=1 ttl=128 time=0.532 ms
64 bytes from  webserver  ( ): icmp_seq=2 ttl=128 time=0.337 ms
64 bytes from  webserver  ( ): icmp_seq=3 ttl=128 time=0.399 ms

Was this helpfull ?


Related Posts Plugin for WordPress, Blogger...

Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Coupons