nsd-xfer bind to local IP

Walter Hop nsd at walter.transip.nl
Sun Aug 14 22:11:30 UTC 2005


I  am  busy on the last steps to integrate NSD with our setup, so that
we can move a nameserver (hopefully all of them) to NSD.

I noticed that it is not possible for nsd-xfer to create a socket with
an arbitrary local IP address. We slave zones from many master servers
which are not managed by ourselves. These people are all expecting our
AXFR's to come from a known IP which is not the interface's primary IP
(for  various  reasons, mainly that we can quickly move the nameserver
IP alias between machines in case of hardware failure).

So I created a small patch for NSD 2.3.0 to specify the source address
to  nsd-xfer.  It  may  be  useful to others as well, so perhaps this*
could  be  included  in  a  future  release.  (*  = Or something which
functions like it, I won't say I am a world class C programmer) :)

The patch adds a command line parameter to nsd-xfer:

  -a src       Local hostname/IP for the connection.

Also it adds nsdxfer_flags to nsdc which can be set in nsdc.conf.

I  have  tested  it  only on FreeBSD 5.4 with IPv4. If you'd specify a
hostname  which  has  both  A  and  AAAA records, I'm pretty sure both
protocols  would  be handled correctly by taking res->ai_family of the
current server and passing it to gethostbyname2().

Any comments are welcome...

On  FreeBSD,  the following patch can be applied to /usr/ports/dns/nsd
after doing a "make extract".

PS:  It  seems  that  there  were  two leftovers called "namedxfer" in
Makefile.in and nsdc.conf.sample.in, I changed these to read "nsdxfer"
as well..

Walter Hop
Transip BV

  Transip BV | http://www.transip.nl/
  Hoogwaardige Innovatie | Aangename Zekerheid

More information about the nsd-users mailing list