Round robin DNS with /etc/hosts?

Linux & Unix newsgroup archiveLinux2002

Linuxmisc » Linux

Jehs #1 / 6 Fri, 05 Jul 2002 03:00:00 GMT
I'm trying to get it so that requests to a certain hostname will
be split up among several IP addresses. The hostname isn't im-
portant, so I could theoretically put it in /etc/hosts.

So for example:
I have a hostname "randomizer", which should evenly distribute
requests among the ips 192.168.0.1 thru 4. Can I do this with
/etc/hosts? I don't want to have to set up a DNS server for this.

Thanks,
Moshe

--
jehsom(@)resnet.gatech.edu - ICQ 1900670 - 350467 GT Sta - 6-0985
Geek code v3.12 (www.geekcode.com):
GCS/E d- s+:- a-- C++$ UL++>+++$ P+>++ L+++>$ E--- W+ N++ w-- !O
M-- V? PS+ PE Y+ !PGP t 5? X+ R- tv b- DI+ D+ G e>++ h !r>r y--

Bill Denne #2 / 6 Fri, 05 Jul 2002 03:00:00 GMT

Couldn't you do something like was described in how to make your sig
file random (earlier thread) and make it work for /etc/hosts?  E.g.
randsig cycles through choices of random files, make cyclehosts
increment the hosts file.  (I know that there are better ways to do this
like choose based on load averages.)

Bill

--
 -=- Bill Denney -=- gte2...@prism.gatech.edu -=-
Seeing is deceiving.  It's eating that's believing.
                -- James Thurber

Peter C. Dilling #3 / 6 Fri, 05 Jul 2002 03:00:00 GMT
Bill Denney once said,

I don't know the answer, but don't do this.

--
Peter C. Dillinger
pet...@cc.gatech.edu

Bob Hau #4 / 6 Sat, 06 Jul 2002 03:00:00 GMT
On 17 Jan 2000 21:12:02 GMT, Jehsom <jeh...@-NOSPAM-resnet.gatech.edu> wrote:

How were you planning to make this rotating name available to the other
machines?  /etc/hosts only works on the local machine.  I'm not seeing how
manually diddling /etc/hosts on every client is easier than setting up an
DNS.

--
 -| Bob Hauck
 -| Wasatch Communications Group
 -| http://www.wasatch.com/~bobh

Jehs #5 / 6 Sat, 06 Jul 2002 03:00:00 GMT
In comp.os.linux.misc Bob Hauck <bobh.at.h...@wasatch.com.invalid> wrote:

It doesn't have to work on any other machine. It's just a way of
directing a program to use multiple IPs when it doesn't support it.

Moshe

--
jehsom(@)resnet.gatech.edu - ICQ 1900670 - 350467 GT Sta - 6-0985
Geek code v3.12 (www.geekcode.com):
GCS/E d- s+:- a-- C++$ UL++>+++$ P+>++ L+++>$ E--- W+ N++ w-- !O
M-- V? PS+ PE Y+ !PGP t 5? X+ R- tv b- DI+ D+ G e>++ h !r>r y--

Jason Pric #6 / 6 Sat, 06 Jul 2002 03:00:00 GMT

Methinks you have no choice.  /etc/hosts (IIRC) is read sequentially, and
gives the first record found that matches.  Named returns a list (a,b,c,d)
for querry 1.  then the list (b,c,d,a) for querry 2, and so on.

Jason

--
Faith is not a matter of questions.      Jason Price
Faith is a matter of answers.            jpr...@gatech.edu
More to the point, one answer:           Theta Xi, Beta Alpha, 449
"Yes, Lord."

This page is kept from the Linuxmisc archive of Linux and Unix newsgroups (snapshot 2022). Posts are shown as they were published, so commands, versions and addresses date from the original discussion. Linuxmisc.com now publishes a guide to online casinos in Canada.