diff -Naur autoaxfr-1.2.orig/autoaxfr autoaxfr-1.2/autoaxfr
--- autoaxfr-1.2.orig/autoaxfr	2002-11-17 21:33:29.000000000 +0100
+++ autoaxfr-1.2/autoaxfr	2005-10-22 15:57:11.532052552 +0200
@@ -40,6 +40,9 @@
 my $root = $ENV{'ROOT'};
 chdir($root) || die "$me: can't chdir($root): $!";
 
+die "$me: no IP environment variable" unless defined $ENV{'IP'};
+my $ip = $ENV{'IP'};
+
 # Is it time to refresh a given slave yet?
 sub time_to_refresh_slave {
     my $slave = shift;
@@ -144,8 +147,8 @@
 	    foreach $addr (@addrs) {
 		print "$me: fetching $slave from $addr\n";
 		my $slave_domain = $slave eq "@" ? "." : $slave;
-		if (!system('tcpclient', '-v', $addr, 'domain', 'axfr-get', 
-			    $slave_domain, "zones/$slave",
+		if (!system('tcpclient', '-i', $ip, '-v', $addr, 'domain',
+			    'axfr-get', $slave_domain, "zones/$slave",
 			    "temp/$slave")) {
 		    last;
 		}
diff -Naur autoaxfr-1.2.orig/autoaxfr-conf autoaxfr-1.2/autoaxfr-conf
--- autoaxfr-1.2.orig/autoaxfr-conf	2002-11-17 21:33:29.000000000 +0100
+++ autoaxfr-1.2/autoaxfr-conf	2005-10-22 15:55:13.869939912 +0200
@@ -28,8 +28,8 @@
 
 my $me = "autoaxfr-conf";
 
-if (@ARGV != 3) {
-    print "$me: usage: $me acct logacct directory\n";
+if (@ARGV != 4) {
+    print "$me: usage: $me acct logacct directory myip\n";
     exit(3);
 }
 
@@ -58,6 +58,17 @@
 }
 $dir = $1;
 
+# client ip address
+my $ip;
+
+unless ($ARGV[3] =~ m/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/) {
+    die "$me: bad ip $ARGV[3]"
+}
+for my $octet (($1, $2, $3, $4)) {
+    die "$me: bad ip $ARGV[3]" if (($octet < 0) || ($octet > 255))
+}
+$ip = $ARGV[3];
+
 # djb style functions
 sub makedir {
     $fn = shift;
@@ -109,8 +120,7 @@
 print OUT <<EOF;
 #!/bin/sh
 exec 2>&1
-ROOT=$dir/root; export ROOT
-exec setuidgid $acct /usr/local/bin/autoaxfr
+exec setuidgid $acct envdir ./env /usr/local/bin/autoaxfr
 EOF
 finish;
 perm(0755);
@@ -127,4 +137,24 @@
 perm(02755);
 owner($acct_uid, $acct_gid);
 
+# Create DIR/env
+makedir('env');
+perm(02755);
+
+# Create DIR/env/IP
+start('env/IP');
+print OUT <<EOF;
+$ip
+EOF
+finish;
+perm(0644);
+
+# Create DIR/env/ROOT
+start('env/ROOT');
+print OUT <<EOF;
+$dir/root
+EOF
+finish;
+perm(0644);
+
 # vim: ts=8 sw=4
