[comp.protocols.tcp-ip.domains] Bind mods to call a program

fwp1@CC.MsState.Edu (Frank Peters) (02/08/91)

Hello,

As part of a load-balancing scheme I would like to experiment with I'd
like to make the following modification to bind 4.8.3.

I would like to add (purely internal to my named) a new record type
PROG that would specify a program to be run.  The output of this
program would then be returned to the querying host as an A record.

As an example of what I mean suppose I have a set of suns that are
licensed to run a software package 'foo' and I would like to make
foosun.where.ever return the least loaded of these hosts.  I might put
an entry like the following in my zone file:

$ORIGIN where.ever.
FooSun         PROG      /usr/local/adm/leastload
               MX    10  MailHub.where.ever.

When named receives an A record request for FooSun.where.ever it would
run leastload passing it the hostname as an argument.  Leastload would
then return an IP address (or exit with one of various result codes to
indicate various errors).  That IP address would then be returned in
an A record (with a very short life span) as if the A record were in
the database.

I've heard various rumors that something similar has been done by
various people but have never been able to actually get ahold of
anyone who has.

So, before I start hacking at bind, has anyone made modifications
similar to the above that they'd be willing to share?

Thanks in advance.

FWP
--
Frank Peters   Internet:  fwp1@CC.MsState.Edu         Bitnet:  FWP1@MsState
               Phone:     (601)325-2942               FAX:     (601)325-8921

ejm@riscit.NOC.Vitalink.COM (Erik J. Murrey) (02/09/91)

In article <FWP1.91Feb7221925@ra.CC.MsState.Edu>, fwp1@CC.MsState.Edu
(Frank Peters) writes:
> 
> I would like to add (purely internal to my named) a new record type
> PROG that would specify a program to be run.  The output of this
> program would then be returned to the querying host as an A record.
> 

> $ORIGIN where.ever.
> FooSun         PROG      /usr/local/adm/leastload
>                MX    10  MailHub.where.ever.
> 

Instead of fork/exec-ing a process for each A query made, how about
creating an RPC (or AF_UNIX) process that waits for requests from your
modified BIND?  This process could reply to BIND's request without the
overhead of a fork + exec.

---
Erik J. Murrey
Vitalink Communications NOC
ejm@NOC.Vitalink.COM	...!uunet!NOC.Vitalink.COM!ejm