Unix administration - Same /etc/hosts File On Multiple Systems

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > March 2004 > Same /etc/hosts File On Multiple Systems





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Same /etc/hosts File On Multiple Systems
Tennis Smith

2004-02-23, 11:34 am

Hi,

I have about 6 or so *nix systems. Some are Linux and some are
Solaris. Can I define _one_ /etc/hosts file and put it on every
system? Or, does every hosts file need to have a particular order of
definitions that are tailored to the individual hosts?

For example, say I have 3 hosts, linux1, linux2, and solaris1. Can I
define an /etc/hosts file which looks like this:

127.0.0.1 localhost loghost
10.10.10.1 linux1
10.10.10.2 linux2
10.10.10.3 solaris1


.... and then simply copy it to /etc/hosts on all three machines?

TIA,
-Tennis
Michael Vilain

2004-02-23, 12:33 pm

In article <7f477f72.0402231707.3c902e83@posting.google.com>,
tennis_smith@yahoo.com (Tennis Smith) wrote:

> Hi,
>
> I have about 6 or so *nix systems. Some are Linux and some are
> Solaris. Can I define _one_ /etc/hosts file and put it on every
> system? Or, does every hosts file need to have a particular order of
> definitions that are tailored to the individual hosts?
>
> For example, say I have 3 hosts, linux1, linux2, and solaris1. Can I
> define an /etc/hosts file which looks like this:
>
> 127.0.0.1 localhost loghost
> 10.10.10.1 linux1
> 10.10.10.2 linux2
> 10.10.10.3 solaris1
>
>
> ... and then simply copy it to /etc/hosts on all three machines?
>
> TIA,
> -Tennis


I did this all the time. The format of /etc/hosts is the same AFAIK on
linux and Solaris. I even designated one system as the 'master' and
used rdist to ensure systems had various files that were up-to-date with
the master.

--
DeeDee, don't press that button! DeeDee! NO! Dee...



Jude

2004-02-24, 12:34 am

tennis_smith@yahoo.com (Tennis Smith) wrote in message news:<7f477f72.0402231707.3c902e83@posting.google.com>...
> Hi,
>
> I have about 6 or so *nix systems. Some are Linux and some are
> Solaris. Can I define _one_ /etc/hosts file and put it on every
> system? Or, does every hosts file need to have a particular order of
> definitions that are tailored to the individual hosts?
>
> For example, say I have 3 hosts, linux1, linux2, and solaris1. Can I
> define an /etc/hosts file which looks like this:
>
> 127.0.0.1 localhost loghost
> 10.10.10.1 linux1
> 10.10.10.2 linux2
> 10.10.10.3 solaris1
>
>
> ... and then simply copy it to /etc/hosts on all three machines?
>
> TIA,
> -Tennis




Hi

Yup that should work a treat, the hosts file is the same format on
Linux and Solaris, and Windows come to think of it.

Jude
Ian Wilson

2004-02-27, 10:34 am

"Michael Vilain " wrote:

> In article <7f477f72.0402231707.3c902e83@posting.google.com>,
> tennis_smith@yahoo.com (Tennis Smith) wrote:
>
>
>
>
> I did this all the time. The format of /etc/hosts is the same AFAIK on
> linux and Solaris. I even designated one system as the 'master' and
> used rdist to ensure systems had various files that were up-to-date with
> the master.
>


For "six or so" systems I'd consider setting one of them up as a DNS
server. NIS/YP also addresses the task of synchronising each systems
view of the "hosts" namespace.

--
Ian Wilson.

Heiner Steven

2004-02-28, 8:33 pm

Tennis Smith wrote:

> I have about 6 or so *nix systems. Some are Linux and some are
> Solaris. Can I define _one_ /etc/hosts file and put it on every
> system? Or, does every hosts file need to have a particular order of
> definitions that are tailored to the individual hosts?
>
> For example, say I have 3 hosts, linux1, linux2, and solaris1. Can I
> define an /etc/hosts file which looks like this:
>
> 127.0.0.1 localhost loghost
> 10.10.10.1 linux1
> 10.10.10.2 linux2
> 10.10.10.3 solaris1
>
>
> ... and then simply copy it to /etc/hosts on all three machines?


You could do so. However, NIS is often used for this purpose.
It can also be used to automatically distribute other files from
a master to several client systems, e.g.

hosts, passwd, aliases, ethers, bootparams, printcap, auto.master, ...

Heiner
--
___ _
/ __| |_ _____ _____ _ _ Heiner STEVEN <heiner.steven@nexgo.de>
\__ \ _/ -_) V / -_) ' \ Shell Script Programmers: visit
|___/\__\___|\_/\___|_||_| http://www.shelldorado.com/
jpd

2004-03-01, 5:33 am

In article <404138d5$0$17561$9b4e6d93@newsread4.arcor-online.net>,
Heiner Steven wrote:
> Tennis Smith wrote:

[snip]

Looking up the manual pages for /etc/hosts on the linux and solaris
machines would have told you that.

[color=darkred]
> You could do so. However, NIS is often used for this purpose.


NIS can do it, sure. ssh and rsync and rdist and others can do it too.

DNS was invented specifically for the purpose of de/centrally managing
this information, so it can do that, too.

And yes, one can have a local nameserver that distributes your local
private network info locally /and/ forwards all the other queries to
another server, say, the one provided by your ISP.

I mean, seriously, why bother with inventing your own solution if you've
got a working, mature system that's in use all over the internet?


--
j p d (at) d s b (dot) t u d e l f t (dot) n l .
Heiner Steven

2004-03-02, 4:35 pm

jpd wrote:
> In article <404138d5$0$17561$9b4e6d93@newsread4.arcor-online.net>,
> Heiner Steven wrote:
>
>
> [snip]
>
>
> Looking up the manual pages for /etc/hosts on the linux and solaris
> machines would have told you that.
>
>
> NIS can do it, sure. ssh and rsync and rdist and others can do it too.
>
> DNS was invented specifically for the purpose of de/centrally managing
> this information, so it can do that, too.
>
> And yes, one can have a local nameserver that distributes your local
> private network info locally /and/ forwards all the other queries to
> another server, say, the one provided by your ISP.
>
> I mean, seriously, why bother with inventing your own solution if you've
> got a working, mature system that's in use all over the internet?


I take this as meaning that a local nameserver would be the
best solution.

Well, if /etc/hosts is the only file that needs to be kept
on different systems, I agree with you. However, often
/etc/hosts is only one part of the information that needs
to be distributed to several hosts, and in this case NIS
can help.

Heiner
--
___ _
/ __| |_ _____ _____ _ _ Heiner STEVEN <heiner.steven@nexgo.de>
\__ \ _/ -_) V / -_) ' \ Shell Script Programmers: visit
|___/\__\___|\_/\___|_||_| http://www.shelldorado.com/
jpd

2004-03-04, 12:34 pm

In article <4044f673$0$14838$9b4e6d93@newsread4.arcor-online.net>,
Heiner Steven wrote:
[snip]
>
> I take this as meaning that a local nameserver would be the
> best solution.


Well, it surely beats copying hosts everywhere. Actually, in the early
days[0] that is what happened, and DNS was the solution they came up with.


> Well, if /etc/hosts is the only file that needs to be kept
> on different systems, I agree with you. However, often
> /etc/hosts is only one part of the information that needs
> to be distributed to several hosts, and in this case NIS
> can help.


NIS (nee YP) was still later and is indeed more general. It does, however
have its own set of problems. I'd still setup a DNS next to NIS if I were
to deploy NIS, as DNS is better supported on more platforms than NIS is.

Nevermind that if you want it all in one system it'd be better to setup
DNS to _feed off_ NIS, but I think that'll be overkill for the situation
as sketched.

Nowadays, of course, the ``way of the world'' would be to setup LDAP
in that role instead of NIS or even NIS+. But this is more complex than
NIS and if NIS isn't overkill, this surely is.


[0] No, I wasn't ``around'' then. I do like to learn from history though.

--
j p d (at) d s b (dot) t u d e l f t (dot) n l .
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com