what's the point of /etc/hosts

what's the point of /etc/hosts

Post by Dave Min » Wed, 10 Jul 1991 23:08:41




> Our site has name servers and our Sun (sunos 4.1.1) is using the
> resolver library to query them.  So what use is /etc/hosts?  Does
> sendmail(.mx) use it?  Anything else?  If it is used; what nodes do we
> need to mention in it?
> --


If you're runing some sort of nameservice (NIS, DNS), the only entries which
are required for a Sun are those which are necessary to get your network interfaces
configured (look at how the ifconfig things are done in rc.boot).  You should also have the loghost alias defined so that syslog will always be happy.  For example,
the machine 'bozo' with a single network interface might have a hosts file like so:

127.0.0.1       localhost loghost
123.45.6.7      bozo

Dave
---------------------------------------------------------------------------

SunSoft, Inc., System & Net Admin Group                          (508) 671-0463
---------------------------------------------------------------------------

 
 
 

1. Is there any point to full host names in /etc/hosts ?

This is the situation: a friend and I both use a broadband router with a few
machines behind them, at our respective homes. We each picked a name for our
'domain'. His is fictional. Mine also exists on the net, but with only the
www and ftp of rikishi42.net defined in the DNS, not my home machines.

He's added 2 of my PC's in the /etc/hosts of his laptop, for use when he
visits and connects it to my LAN.

This would be a sample from that file:

# Home net
192.168.108.101   desktop.myDomain    desktop
192.168.108.124   laptop.myDomain     laptop
192.168.108.101   server.myDomain     server
#Rikishi's net
192.168.8.142   gramps.rikishi42.net  gramps
192.168.8.181   pigmy.rikishi42.net   pigmy

We've allways used this, works just fine.
When connectiong to my machines, he's allways used the short (host only)
name. Last time, he accidentally tried with the full name. It failed.

My guess is that, upon finding that rikishi42.net exists, there is an
attempt to get the address from the DNS, skipping hosts all together.

But do I presume correctly, or is there more to it?

--
There is an art, it says, or rather, a knack to flying.
The knack lies in learning how to throw yourself at the ground and miss.
Douglas Adams

2. Sleeping or not?

3. SOLUTIONS TO: /etc/rc.net, /etc/host.conf and 'ps' problems

4. How to change an IP Address on a Sun Box

5. 'host' command not using /etc/hosts?

6. Need local system builder who will build EXACTLY to-spec (SF Bay Area)

7. Limit Telnet's to Host in /etc/hosts

8. FrontPage Server Extensions 1,5 Mega???

9. /etc/hosts.deny & /etc/hosts.allow ??

10. /etc/hosts.deny and /etc/hosts.allow

11. tunnel point to point vs physical point to point

12. Looking for sample /etc/named.conf and etc/resolv.conf and /etc/hosts

13. point to point route to host using 2nd nic for private backups?