localhost or LAN addresses in /etc/hosts

Chris G cl at isbd.net
Tue Dec 16 10:01:18 UTC 2008


On Mon, Dec 15, 2008 at 07:58:21PM -0800, NoOp wrote:
> On 12/15/2008 04:30 PM, Chris G wrote:
> > On Mon, Dec 15, 2008 at 01:57:50PM -0800, NoOp wrote:
> >> On 12/15/2008 11:50 AM, Chris G wrote:
> >> 
> >> > 
> >> > My /etc/hosts now has:-
> >> > 
> >> >     127.0.0.1       localhost.localdomain   localhost
> >> > 
> >> >     192.168.1.1 vigor 2820n
> >> >     192.168.1.4 home.isbd.net isbd 84-45-228-40.no-dns-yet.enta.net chris.isbd.net
> >> >     192.168.1.5 home
> >> >     192.168.1.6 maxine
> >> >     192.168.1.7 garage
> >> >     ... plus more lines.
> >> > 
> >> > 
> >> > If I say 'host isbd' on the garage system see what happens:-
> >> > 
> >> >     chris at garage:~$ host isbd
> >> >     isbd has address 192.168.1.4
> >> >     chris at garage:~$ 
> >> > 
> >> > The garage system has a default /etc/hosts, I've added nothing to it.
> >> > 
> >> > 
> >> > So it seems to me I'm getting exactly what I need, a DNS system that
> >> > gives me valid LAN addresses for local names.
> >> 
> >> Question: what happens when the single machine with dnsmasq is
> >> down/off-line etc? Wouldn't you be better off putting the IP's in the
> >> /etc/hosts files of each machine (adjusted accordingly of course)?
> >> 
> > Er, the same as happens when the router is down - not much!  :-)
> > 
> 
> Yes, but then you must keep the dnsmasq machine up at all times - what
> ever happend to 'green'... :-)
> 
It's a green machine - I specifically bought components to keep its
power consumption to a minimum.  It also provides samba services to
other machines on the network, and local web pages.


> will still have the ability to ping by name if you configure each
> /etc/host file to include the appropriate IP addresses and name for each
> device. For example with 'garage':
> 
> 127.0.0.1       localhost
> 127.0.1.1	garage
> 
> 192.168.1.1 vigor 2820n
> 192.168.1.4 home.isbd.net isbd 84-45-228-40.no-dns-yet.enta.net
> chris.isbd.net
> 192.168.1.5 home
> 192.168.1.6 maxine
> 
> garage would still be able to easily find 'home' or maxine' (I'm not
> sure about the isbd.net stuff).
> 
Yes, I know that, but it requires that I keep all the /etc/hosts files
up to date and in step.  In reality the garage machine is purely a
backup machine so it doesn't *need* to be able to see anything much.


> Or maxine:
> 
> 127.0.0.1       localhost
> 127.0.1.1	maxine
> 
> 192.168.1.1 vigor 2820n
> 192.168.1.4 home.isbd.net isbd 84-45-228-40.no-dns-yet.enta.net
> chris.isbd.net
> 192.168.1.5 home
> 192.168.1.7 garage
> 
> maxine would still be able to easily find 'garage'.
> 
The machine maxine is a WIndows machine, doesn't need to see garage,
just the printers really.

-- 
Chris Green




More information about the ubuntu-users mailing list