How to configure Hosts file in Linux machines

FREQUENTLY ASKED QUESTIONS  (Linux)
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
192.168.10.53   webserver                (Add a hostname entry for system 192.168.10.53) 
#(save the hosts file)


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

0 comments:

Related Posts Plugin for WordPress, Blogger...

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