One last set of linux file sharing questions

Longman, Bill yellowdog-newbie@lists.terrasoftsolutions.com
Mon, 15 Sep 2003 10:48:19 -0700


> Subject: Re: One last set of linux file sharing questions
> 
> 
> It's the non-gui way.  I run my YDL headless, i.e. no monitor.  It is 
> useful
> to know how to configure it sans redhat-config apps.
> 
> Sean
> 
> On Sunday, September 14, 2003, at 08:51  PM, eps22 wrote:
> 
> > What's the benefit of doing this?
> >

The biggest benefit is that you can now do this:

ssh 2@eps

...you don't need to know the IP address. When you find yourself having to
type IP addresses, then head for the /etc/hosts file and enter the
name/address pair in there.


<tutelage>

ssh foo.bar.com

Your machine doesn't immediately know who foo.bar.com is. It needs to change
the name to an IP address so it can do its stuff.

Your /etc/nsswitch.conf file is the mastermind of how this gets done. In
fact, it does this same kind of control for many other lookups. If you look
in this file, you'll see entries for different services that use lookups --
usernames and passwords, groups, hosts -- and the resolv.conf file tells the
system in which order these services are to be configured.

My "hosts" entry says this:

hosts:   files dns

Whenever my system needs to lookup a host, it will first look in my
/etc/hosts file for the name I just gave it. If it finds it in there, it
will return the address found as the correct one to use. If it is not found
there, it will then ask DNS for the IP address from the name I have given.

There are two files, then, that give you your naming services: /etc/hosts
and /etc/resolv.conf. The hosts file is the hard-coded lookups on your local
machine. You usually put machines on your local network into this file so
you can conveniently use short names instead of long IP addresses. The
resolv.conf file contains the hosts that run the DNS service and look up the
names from across the web for you. All this file does is tell your system to
go ask somebody else. Then your system queries the DNS server and it gets a
reply with the IP address you've been searching for.

</tutelage>