View Single Post
  #3  
Old 25th October 2005, 00:34
themachine themachine is offline
Senior Member
 
Join Date: Oct 2005
Location: Texas, USA
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The /etc/hosts file simply maps IPs to hostnames. If you look in your '/etc/nsswitch.conf' file, you'll see lines similar to:

Code:
hosts: files dns
ip_nodes: files dns
networks: dns
...etc. So, looking at that example... if you ping a host it will look for the hostname in /etc/hosts first, and if it doesn't find anything it will query dns.

To answer your question, 'server1.example.com' and 'server1' are both hostnames that point to 192.168.0.100. You could list as many names as you like this way. So I could 'ping server1' and it will ping 192.168.0.100... or I could 'ping server1.example.com' and it will also ping 192.168.0.100.
__________________
themachine
5dollarwhitebox.org
Reply With Quote