D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] /etc/hosts

 

On Fri, Sep 7, 2012 at 12:52 PM, paul sutton wrote:
> So how does my netbook know where everything is, (e.g raspbrry pi) when
> its not listed in the local /etc/hosts file

You know the IP address, don't you? There are low-level protocols that
help devices know which IP addresses correspond to which devices
(actually, which network interfaces).

Or perhaps you mean how it can link hostname and IP address without
using a hosts file, or a DNS server. It can't. (Note that it's
possible for your router to run a DNS server. Mine does, though I
haven't figured out if I can add custom hostnames to it as well.)

> I don't have a dns server which I am guessing you suggest i need so 1
> computer to hold /etc/hosts for each computer on the network

Yes. Have a look at dnsmasq - it's a very simple DNS server which does
an excellent job of resolving some local hostnames and using a
'proper', external DNS server for all other lookups.

> I am on;y doing this so I don't have to remember the ip addresses, if I
> want to ssh in the pi from the netbook surely i need to have   ip
> raspberrypi in the netbooks /etc/hosts file

Yes, but with a DNS server you don't have to keep multiple copies of
/etc/hosts on all devices on your local network.

Martijn.

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq