Index: adns/INSTALL
diff -u adns/INSTALL:1.2 adns/INSTALL:1.3
--- adns/INSTALL:1.2	Wed Jul 28 23:46:36 1999
+++ adns/INSTALL	Sun Oct 10 14:16:23 1999
@@ -26,7 +26,9 @@
 This file, INSTALL, contains installation instructions and other
 details for adns.
 
-adns is Copyright (C)1997-9 Ian Jackson <ian@davenant.greenend.org.uk>.
+adns is
+ Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ Copyright (C) 1999 Tony Finch <dot@dotat.at>
 
 adns is free software; you can redistribute it and/or modify it under
 the terms of the GNU General Public License as published by the Free
Index: adns/Makefile.in
diff -u adns/Makefile.in:1.13 adns/Makefile.in:1.16
--- adns/Makefile.in:1.13	Thu Aug  5 01:18:13 1999
+++ adns/Makefile.in	Wed Oct 13 02:26:09 1999
@@ -1,7 +1,12 @@
 # Makefile - top-level Makefile
-# 
-#  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
 #  
+#  This file is
+#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#
+#  It is part of adns, which is
+#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#    Copyright (C) 1999 Tony Finch <dot@dotat.at>
+# 
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
 #  the Free Software Foundation; either version 2, or (at your option)
@@ -16,7 +21,7 @@
 #  along with this program; if not, write to the Free Software Foundation,
 #  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
 
-DISTVERSION=	0.4
+DISTVERSION=	0.5
 srcdir=		@srcdir@
 VPATH=		@srcdir@
 
@@ -29,7 +34,7 @@
 all-here install-here uninstall-here distprep-here:	README
 
 clean-here mostlyclean-here:
-		rm -f *~ ./#*# core *.orig *.rej Makefile adns-*.tar.gz
+		rm -f *~ ./#*# core *.orig *.rej adns-*.tar.gz
 		rm -rf dist_tmp
 
 distclean-here maintainer-clean-here:	clean-here
Index: adns/README
diff -u adns/README:1.4 adns/README:1.5
--- adns/README:1.4	Thu Jul 15 00:43:28 1999
+++ adns/README	Wed Oct 13 02:33:19 1999
@@ -1,5 +1,5 @@
 
-                                     adns
+                                   GNU adns
                                        
    Advanced, easy to use, asynchronous-capable DNS client library.
    
@@ -44,17 +44,17 @@
      * Some kind of awareness of DNSSEC.
      * Possibly some very limited caching behaviour.
        
-   (Technical note: adns requires a real nameserver like BIND or [1]Dents
-   running on the same system or a nearby one, which must be willing to
-   provide `recursive service'. I.e., adns is a `stub resolver'. All
-   properly configured UN*X and GNU systems will already have such
-   nameserver(s); they are usually listed in /etc/resolv.conf.)
+   (Technical note: adns requires a real nameserver like [1]BIND or
+   [2]Dents running on the same system or a nearby one, which must be
+   willing to provide `recursive service'. I.e., adns is a `stub
+   resolver'. All properly configured UN*X and GNU systems will already
+   have such nameserver(s); they are usually listed in /etc/resolv.conf.)
    
 Documentation
 
    I'm afraid there is no manual yet. However, competent C programmers
-   should be able to use the library based on the commented [2]adns.h
-   header file (from version 0.3).
+   should be able to use the library based on the commented [3]adns.h
+   header file (from version 0.4).
    
 Feedback
 
@@ -74,22 +74,25 @@
    important bugs, new versions, &c. The bug reports address mentioned
    above is also a mailing list; feel free to subscribe to it.
    
-   There are [3]archives and subscription web pages, or you can subscribe
+   There are [4]archives and subscription web pages, or you can subscribe
    by sending mail containing the word `subscribe' to
    adns-announce-REQUEST@chiark.greenend.org.uk or
    adns-discuss-REQUEST@chiark.greenend.org.uk.
    
 Download
 
-   Available for download from [4]chiark.greenend.org.uk are:
-     * The [5]current pre-release version as a gzipped tarfile.
-     * [6]adns.h API header file with comments (currently there is no
+   Available for download from [5]chiark.greenend.org.uk are:
+     * The [6]current pre-release version as a gzipped tarfile.
+     * [7]adns.h API header file with comments (currently there is no
        manual, sorry).
-     * All versions released so far are also available via [7]anonymous
+     * All versions released so far are also available via [8]anonymous
        FTP.
+     * A mirror of my CVS repository is available via rsync from
+       rsync.chiark.greenend.org.uk::ftp/users/ian/cvs-pub/adns (use FTP
+       first to find your way around).
        
-   adns is also available from the [8]GNU Project FTP servers and their
-   [9]mirrors.
+   adns is also available from the [9]GNU Project FTP servers and their
+   [10]mirrors.
    
 Copyright and licensing
 
@@ -103,42 +106,43 @@
    This program and documentation is distributed in the hope that it will
    be useful, but without any warranty; without even the implied warranty
    of merchantability or fitness for a particular purpose. See the
-   [10]GNU General Public License for more details.
+   [11]GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
    along with adns, or one should be available above; if not, write to
-   the [11]Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+   the [12]Free Software Foundation, 59 Temple Place - Suite 330, Boston,
    MA 02111-1307, USA, or email adns-maint@chiark.greenend.org.uk.
      _________________________________________________________________
    
-   [12]Ian Jackson / [13]adns-maint@chiark.greenend.org.uk; more [14]free
+   [13]Ian Jackson / [14]adns-maint@chiark.greenend.org.uk; more [15]free
    software by me.
    
-   [15]GNU home page; [16]chiark home page; [17]site or mirror home page
+   [16]GNU home page; [17]chiark home page; [18]site or mirror home page
    
    This web page is Copyright (C)1996-1999 Ian Jackson. See the
-   [18]Copyright/acknowledgements.
+   [19]Copyright/acknowledgements.
    
-   Use any browser - [19]Campaign for a non-browser-specific WWW
+   Use any browser - [20]Campaign for a non-browser-specific WWW
 
 References
 
-   1. http://www.dents.org/
-   2. http://www.chiark.greenend.org.uk/~ian/adns/adns.h.0.3.txt
-   3. http://www.chiark.greenend.org.uk/mailman/listinfo
-   4. http://www.chiark.greenend.org.uk/~ian/adns/
-   5. http://www.chiark.greenend.org.uk/~ian/adns/adns.tar.gz
-   6. http://www.chiark.greenend.org.uk/~ian/adns/adns.h.0.3.txt
-   7. ftp://ftp.chiark.greenend.org.uk/users/ian/adns/
-   8. http://www.gnu.org/
-   9. http://www.gnu.org/order/ftp.html
-  10. http://www.chiark.greenend.org.uk/~ian/COPYING.txt
-  11. http://www.fsf.org/
-  12. http://www.chiark.greenend.org.uk/
-  13. mailto:adns-maint@chiark.greenend.org.uk
-  14. http://www.chiark.greenend.org.uk/~ian/software/
-  15. http://www.gnu.org/
-  16. http://www.chiark.greenend.org.uk/
+   1. http://www.isc.org/view.cgi?/products/BIND/index.phtml
+   2. http://www.dents.org/
+   3. http://www.chiark.greenend.org.uk/~ian/adns/adns.h.0.4.txt
+   4. http://www.chiark.greenend.org.uk/mailman/listinfo
+   5. http://www.chiark.greenend.org.uk/~ian/adns/
+   6. http://www.chiark.greenend.org.uk/~ian/adns/adns.tar.gz
+   7. http://www.chiark.greenend.org.uk/~ian/adns/adns.h.0.5.txt
+   8. ftp://ftp.chiark.greenend.org.uk/users/ian/adns/
+   9. http://www.gnu.org/
+  10. http://www.gnu.org/order/ftp.html
+  11. http://www.chiark.greenend.org.uk/~ian/COPYING.txt
+  12. http://www.fsf.org/
+  13. http://www.chiark.greenend.org.uk/
+  14. mailto:adns-maint@chiark.greenend.org.uk
+  15. http://www.chiark.greenend.org.uk/~ian/software/
+  16. http://www.gnu.org/
   17. http://www.chiark.greenend.org.uk/
-  18. http://www.chiark.greenend.org.uk/~ian/sw-www-copy.html
-  19. http://www.anybrowser.org/campaign/
+  18. http://www.chiark.greenend.org.uk/
+  19. http://www.chiark.greenend.org.uk/~ian/sw-www-copy.html
+  20. http://www.anybrowser.org/campaign/
Index: adns/TODO
diff -u adns/TODO:1.6 adns/TODO:1.9
--- adns/TODO:1.6	Thu Aug  5 01:12:44 1999
+++ adns/TODO	Sat Aug 14 19:55:08 1999
@@ -1,5 +1,12 @@
+INVESTIGATE:
+* coredump in adnstest_s
+
+BUGS:
+* adns_qf_quoteok_cname should be the default.
+
 WISHLIST:
 * Easy way to make a reverse query.
+* Make timeouts configurable.
 * `fake' reverse queries (give nnn.nnn.nnn.nnn either always or on error)
 * `fake' forward queries (allow nnn.nnn.nnn.nnn -> A)
 * DNSSEC compatibility - be able to retreive KEY and SIG RRs
Index: adns/acconfig.h
diff -u adns/acconfig.h:1.3 adns/acconfig.h:1.5
--- adns/acconfig.h:1.3	Wed Jul 14 23:59:34 1999
+++ adns/acconfig.h	Sun Oct 10 14:16:23 1999
@@ -3,7 +3,12 @@
  * input file for autoheader/autoconf/configure: extra stuff for config.h
  */
 /*
- *  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
  *  
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -32,6 +37,9 @@
 /* Define if printf-format argument lists a la GCC are available.  */
 #undef HAVE_GNUC25_PRINTFFORMAT
 
+/* Define if we want to include rpc/types.h.  Crap BSDs put INADDR_LOOPBACK there. */
+#undef HAVEUSE_RPCTYPES_H
+
 @BOTTOM@
 
 /* Use the definitions: */
@@ -94,4 +102,8 @@
 #endif
 #ifndef CONSTANT
 #define CONSTANT FUNCATTR((ATTRCONST))
+#endif
+
+#ifdef HAVEUSE_RPCTYPES_H
+#include <rpc/types.h>
 #endif
Index: adns/aclocal.m4
diff -u adns/aclocal.m4:1.2 adns/aclocal.m4:1.3
--- adns/aclocal.m4:1.2	Sun May  9 16:19:43 1999
+++ adns/aclocal.m4	Sun Oct 10 14:16:23 1999
@@ -1,5 +1,12 @@
 # aclocal.m4 - package-specific macros for autoconf
 #  
+#  This file is
+#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#
+#  It is part of adns, which is
+#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#    Copyright (C) 1999 Tony Finch <dot@dotat.at>
+#  
 #  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
 #
 #  This program is free software; you can redistribute it and/or modify
Index: adns/changelog
diff -u adns/changelog:1.29 adns/changelog:1.58
--- adns/changelog:1.29	Thu Aug  5 01:21:59 1999
+++ adns/changelog	Wed Oct 13 02:24:43 1999
@@ -1,3 +1,54 @@
+adns (0.5) unstable; urgency=high
+
+  New features:
+  * adnslogres, ~100x faster replacement for Apache logresolve;
+    Thanks to Tony Finch for the program and the performance figure.
+  * Internal consistency checking with assert if right options set.
+  * adns_wait_poll function like adns_wait but uses poll, not select.
+  * adns_reverse_submit function for easy in-addr queries.
+  * adns_errtypeabbrev funcion for getting eg "permfail" from _s_nodata.
+  * adnshost utility for scripts and the like (rather alpha).
+
+  Incompatible changes:
+  * RRs with mailboxes never rejected due to strange chars if _raw.
+  * Lack of a mailbox produces `.' not `<>'.
+  * Better usage messages (and no default query domain) for adnstest.
+  * Return EAGAIN from _check instead of EWOULDBLOCK.
+  * adns_rr_info on _r_mx etc. shows status type abbrev and status number.
+  
+  Bugfixes:
+  * Do not invoke __autosys indirectly from __procdgram (result: coredump
+    usually in memmove, unless adns_if_noautosys was used).
+  * Do not scramble innards when a query on the output queue is cancelled.
+  * Do not close tcp socket twice.
+  * Mailboxes containing spaces in their names are quoted.
+  * Give ESRCH, not EAGAIN, if _check called with no queries outstanding.
+  * adns_rr_hostaddr naddrs is -1 on temporary failure (as documented).
+  * Reject TXT RRs with no strings.
+  * Correct error messages for qname CNAME foo, foo CNAME bar.
+  * adns_processany actually does something.
+  * Fixed typos in adns.h.
+
+  General improvements:
+  * Promise not to change fds in adns_beforepoll (if now is specified).
+  * Improved textual error string for _s_prohibitedcname.
+  * New comment in adns_processany and return 0 (not r which is 0).
+  * Documentation of resolv.conf directives and options, and of environment
+    variables understood, in adns.h
+  * Regression test scripts set EF_DISABLE_BANNER (for Electric Fence).
+
+  Portability and build improvements:
+  * Give install the '-c' flag (otherwise some delete the original !).
+  * Do not remove top-level Makefile on `make clean'.
+  * Don't complain so much about poll(2) tests if not available.
+  * Do not give -u 0 -g 0 options to install.
+  * Remove trailing , from some enums in adns.h.
+  * Dynamically linked clients now made with -l, so as to avoid rpath.
+  * Do not use $^ in make rules (should help with non-GNU make).
+  * Declare flags parameters as ints not enums because C++ is crap.
+
+ -- Ian Jackson <ian@davenant.greenend.org.uk>  Wed, 13 Oct 1999 02:24:35 +0100
+
 adns (0.4) unstable; urgency=high
 
   General important bugfixes:
@@ -78,4 +129,5 @@
 
 Local variables:
 mode: debian-changelog
+fill-column: 75
 End:
Index: adns/configure
diff -u adns/configure:1.6 adns/configure:1.8
--- adns/configure:1.6	Mon Jul  5 02:50:59 1999
+++ adns/configure	Wed Oct 13 02:16:30 1999
@@ -689,10 +689,71 @@
   test "${CFLAGS+set}" = set || CFLAGS="-g"
 fi
 
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:694: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    # This must be in double quotes, not single quotes, because CPP may get
+  # substituted into the Makefile and "${CC-cc}" will confuse make.
+  CPP="${CC-cc} -E"
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp.
+  cat > conftest.$ac_ext <<EOF
+#line 709 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:715: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -E -traditional-cpp"
+  cat > conftest.$ac_ext <<EOF
+#line 726 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+  ac_cv_prog_CPP="$CPP"
+fi
+  CPP="$ac_cv_prog_CPP"
+else
+  ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:696: checking for $ac_word" >&5
+echo "configure:757: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -722,12 +783,12 @@
 for ac_func in poll
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:726: checking for $ac_func" >&5
+echo "configure:787: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 731 "configure"
+#line 792 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -750,7 +811,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:754: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -776,12 +837,12 @@
 
 
  echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:780: checking for socket" >&5
+echo "configure:841: checking for socket" >&5
 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 785 "configure"
+#line 846 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -804,7 +865,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_socket=yes"
 else
@@ -823,7 +884,7 @@
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:827: checking for socket in -lsocket" >&5
+echo "configure:888: checking for socket in -lsocket" >&5
 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -831,7 +892,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 835 "configure"
+#line 896 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -842,7 +903,7 @@
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -878,12 +939,12 @@
 
 
  echo $ac_n "checking for inet_ntoa""... $ac_c" 1>&6
-echo "configure:882: checking for inet_ntoa" >&5
+echo "configure:943: checking for inet_ntoa" >&5
 if eval "test \"`echo '$''{'ac_cv_func_inet_ntoa'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 887 "configure"
+#line 948 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char inet_ntoa(); below.  */
@@ -906,7 +967,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_inet_ntoa=yes"
 else
@@ -925,7 +986,7 @@
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for inet_ntoa in -lnsl""... $ac_c" 1>&6
-echo "configure:929: checking for inet_ntoa in -lnsl" >&5
+echo "configure:990: checking for inet_ntoa in -lnsl" >&5
 ac_lib_var=`echo nsl'_'inet_ntoa | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -933,7 +994,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 937 "configure"
+#line 998 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -944,7 +1005,7 @@
 inet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -979,14 +1040,93 @@
 
 
 
+echo $ac_n "checking for INADDR_LOOPBACK""... $ac_c" 1>&6
+echo "configure:1045: checking for INADDR_LOOPBACK" >&5
+if eval "test \"`echo '$''{'adns_cv_decl_inaddrloopback'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+ cat > conftest.$ac_ext <<EOF
+#line 1051 "configure"
+#include "confdefs.h"
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+ 
+int main() {
 
+  INADDR_LOOPBACK;
+ 
+; return 0; }
+EOF
+if { (eval echo configure:1064: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  adns_cv_decl_inaddrloopback=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  adns_cv_decl_inaddrloopback=no
+fi
+rm -f conftest*
+fi
+
+if test "$adns_cv_decl_inaddrloopback" = yes; then
+ echo "$ac_t""found" 1>&6
+else
+ echo "$ac_t""not in standard headers, urgh..." 1>&6
+ ac_safe=`echo "rpc/types.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for rpc/types.h""... $ac_c" 1>&6
+echo "configure:1082: checking for rpc/types.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1087 "configure"
+#include "confdefs.h"
+#include <rpc/types.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  
+  cat >> confdefs.h <<\EOF
+#define HAVEUSE_RPCTYPES_H 1
+EOF
+
+ 
+else
+  echo "$ac_t""no" 1>&6
+
+  { echo "configure: error: cannot find INADDR_LOOPBACK or rpc/types.h" 1>&2; exit 1; }
+ 
+fi
+
+fi
+
+
  echo $ac_n "checking for inet_aton""... $ac_c" 1>&6
-echo "configure:985: checking for inet_aton" >&5
+echo "configure:1125: checking for inet_aton" >&5
 if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 990 "configure"
+#line 1130 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char inet_aton(); below.  */
@@ -1009,7 +1149,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_inet_aton=yes"
 else
@@ -1028,7 +1168,7 @@
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6
-echo "configure:1032: checking for inet_aton in -lresolv" >&5
+echo "configure:1172: checking for inet_aton in -lresolv" >&5
 ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1036,7 +1176,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1040 "configure"
+#line 1180 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1047,7 +1187,7 @@
 inet_aton()
 ; return 0; }
 EOF
-if { (eval echo configure:1051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1081,20 +1221,20 @@
 
  
  echo $ac_n "checking __attribute__((,,))""... $ac_c" 1>&6
-echo "configure:1085: checking __attribute__((,,))" >&5
+echo "configure:1225: checking __attribute__((,,))" >&5
  if eval "test \"`echo '$''{'adns_cv_c_attribute_supported'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
   cat > conftest.$ac_ext <<EOF
-#line 1091 "configure"
+#line 1231 "configure"
 #include "confdefs.h"
 
 int main() {
 extern int testfunction(int x) __attribute__((,,))
 ; return 0; }
 EOF
-if { (eval echo configure:1098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1238: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   adns_cv_c_attribute_supported=yes
 else
@@ -1116,20 +1256,20 @@
 
    
  echo $ac_n "checking __attribute__((noreturn))""... $ac_c" 1>&6
-echo "configure:1120: checking __attribute__((noreturn))" >&5
+echo "configure:1260: checking __attribute__((noreturn))" >&5
  if eval "test \"`echo '$''{'adns_cv_c_attribute_noreturn'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
   cat > conftest.$ac_ext <<EOF
-#line 1126 "configure"
+#line 1266 "configure"
 #include "confdefs.h"
 
 int main() {
 extern int testfunction(int x) __attribute__((noreturn))
 ; return 0; }
 EOF
-if { (eval echo configure:1133: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1273: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   adns_cv_c_attribute_noreturn=yes
 else
@@ -1156,20 +1296,20 @@
 
    
  echo $ac_n "checking __attribute__((const))""... $ac_c" 1>&6
-echo "configure:1160: checking __attribute__((const))" >&5
+echo "configure:1300: checking __attribute__((const))" >&5
  if eval "test \"`echo '$''{'adns_cv_c_attribute_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
   cat > conftest.$ac_ext <<EOF
-#line 1166 "configure"
+#line 1306 "configure"
 #include "confdefs.h"
 
 int main() {
 extern int testfunction(int x) __attribute__((const))
 ; return 0; }
 EOF
-if { (eval echo configure:1173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   adns_cv_c_attribute_const=yes
 else
@@ -1196,20 +1336,20 @@
 
    
  echo $ac_n "checking __attribute__((format...))""... $ac_c" 1>&6
-echo "configure:1200: checking __attribute__((format...))" >&5
+echo "configure:1340: checking __attribute__((format...))" >&5
  if eval "test \"`echo '$''{'adns_cv_attribute_format'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
   cat > conftest.$ac_ext <<EOF
-#line 1206 "configure"
+#line 1346 "configure"
 #include "confdefs.h"
 
 int main() {
 extern int testfunction(char *y, ...) __attribute__((format(printf,1,2)))
 ; return 0; }
 EOF
-if { (eval echo configure:1213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1353: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   adns_cv_attribute_format=yes
 else
@@ -1256,12 +1396,16 @@
 
 
 
+
+
 SHLIBCC='$(CC) $(CFLAGS) -fpic'
 MKSHLIB_1='$(CC) $(LDFLAGS) -shared -Wxl,soname=$(SONAME) -o'
 MKSHLIB_2=''
 MKSHLIB_3='-lc'
-SHLIBFILE='libadns.so.$(MAJOR).$(MINOR)'
-SHLIBSONAME='libadns.so.$(MAJOR)'
+
+SHLIBFORLINK='libadns.so'
+SHLIBSONAME='$(SHLIBFORLINK).$(MAJOR)'
+SHLIBFILE='$(SHLIBSONAME).$(MINOR)'
 
 trap '' 1 2 15
 cat > confcache <<\EOF
@@ -1396,12 +1540,14 @@
 s%@infodir@%$infodir%g
 s%@mandir@%$mandir%g
 s%@CC@%$CC%g
+s%@CPP@%$CPP%g
 s%@RANLIB@%$RANLIB%g
 s%@WARNS@%$WARNS%g
 s%@SHLIBCC@%$SHLIBCC%g
 s%@MKSHLIB_1@%$MKSHLIB_1%g
 s%@MKSHLIB_2@%$MKSHLIB_2%g
 s%@MKSHLIB_3@%$MKSHLIB_3%g
+s%@SHLIBFORLINK@%$SHLIBFORLINK%g
 s%@SHLIBFILE@%$SHLIBFILE%g
 s%@SHLIBSONAME@%$SHLIBSONAME%g
 
Index: adns/configure.in
diff -u adns/configure.in:1.6 adns/configure.in:1.9
--- adns/configure.in:1.6	Mon Jul  5 02:51:04 1999
+++ adns/configure.in	Wed Oct 13 02:16:30 1999
@@ -1,7 +1,12 @@
 # configure.in - input to autoconf
 #  
-#  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+#  This file is
+#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
 #
+#  It is part of adns, which is
+#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#    Copyright (C) 1999 Tony Finch <dot@dotat.at>
+#  
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
 #  the Free Software Foundation; either version 2, or (at your option)
@@ -19,12 +24,35 @@
 AC_INIT(src/adns.h)
 AC_CONFIG_HEADER(src/config.h)
 AC_PROG_CC
+AC_PROG_CPP
 AC_PROG_RANLIB
 
 AC_CHECK_FUNCS(poll)
 ADNS_C_GETFUNC(socket,socket)
 ADNS_C_GETFUNC(inet_ntoa,nsl)
 
+AC_MSG_CHECKING(for INADDR_LOOPBACK)
+AC_CACHE_VAL(adns_cv_decl_inaddrloopback,[
+ AC_TRY_COMPILE([
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+ ],[
+  INADDR_LOOPBACK;
+ ],
+ adns_cv_decl_inaddrloopback=yes,
+ adns_cv_decl_inaddrloopback=no)])
+if test "$adns_cv_decl_inaddrloopback" = yes; then
+ AC_MSG_RESULT(found)
+else
+ AC_MSG_RESULT([not in standard headers, urgh...])
+ AC_CHECK_HEADER(rpc/types.h,[
+  AC_DEFINE(HAVEUSE_RPCTYPES_H)
+ ],[
+  AC_MSG_ERROR([cannot find INADDR_LOOPBACK or rpc/types.h])
+ ])
+fi
+
 ADNS_C_GETFUNC(inet_aton,resolv,[
  LIBS="-lresolv $LIBS";
  AC_MSG_WARN([inet_aton is in libresolv, urgh.  Must use -lresolv.])
@@ -44,6 +72,8 @@
 AC_SUBST(MKSHLIB_1)
 AC_SUBST(MKSHLIB_2)
 AC_SUBST(MKSHLIB_3)
+
+AC_SUBST(SHLIBFORLINK)
 AC_SUBST(SHLIBFILE)
 AC_SUBST(SHLIBSONAME)
 
@@ -51,8 +81,10 @@
 MKSHLIB_1='$(CC) $(LDFLAGS) -shared -Wxl,soname=$(SONAME) -o'
 MKSHLIB_2=''
 MKSHLIB_3='-lc'
-SHLIBFILE='libadns.so.$(MAJOR).$(MINOR)'
-SHLIBSONAME='libadns.so.$(MAJOR)'
+
+SHLIBFORLINK='libadns.so'
+SHLIBSONAME='$(SHLIBFORLINK).$(MAJOR)'
+SHLIBFILE='$(SHLIBSONAME).$(MINOR)'
 
 AC_OUTPUT(
 	settings.make Makefile
Index: adns/settings.make.in
diff -u adns/settings.make.in:1.8 adns/settings.make.in:1.12
--- adns/settings.make.in:1.8	Sun May  9 16:19:44 1999
+++ adns/settings.make.in	Wed Oct 13 02:16:30 1999
@@ -1,8 +1,13 @@
 # settings.make.in - main configuration settings for Makefiles,
 #  used by autoconf/configure to generate settings.make
 #  
-#  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+#  This file is
+#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
 #
+#  It is part of adns, which is
+#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#    Copyright (C) 1999 Tony Finch <dot@dotat.at>
+#  
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
 #  the Free Software Foundation; either version 2, or (at your option)
@@ -21,6 +26,7 @@
 MINOR=		1
 SHLIBFILE=	@SHLIBFILE@
 SHLIBSONAME=	@SHLIBSONAME@
+SHLIBFORLINK=	@SHLIBFORLINK@
 
 CC=		@CC@
 CFLAGS=		$(AUTOCFLAGS) $(WARNS) $(WERROR) $(DIRCFLAGS) $(XCFLAGS)
@@ -44,7 +50,7 @@
 lib_dir=	$(exec_prefix)/lib
 include_dir=	$(prefix)/include
 
-INSTALL=		install -o 0 -g 0
+INSTALL=		install -c
 INSTALL_PROGRAM=	$(INSTALL) -m 755 $(INSTALL_PROGRAM_FLAGS)
 INSTALL_DATA=		$(INSTALL) -m 644
 
Index: adns/client/.cvsignore
diff -u adns/client/.cvsignore:1.3 adns/client/.cvsignore:1.5
--- adns/client/.cvsignore:1.3	Sat Apr 17 15:20:20 1999
+++ adns/client/.cvsignore	Sun Aug 15 18:23:14 1999
@@ -1,3 +1,7 @@
 Makefile
 adnstest
 adnstest_s
+adnslogres
+adnslogres_s
+adnshost
+adnshost_s
Index: adns/client/Makefile.in
diff -u adns/client/Makefile.in:1.7 adns/client/Makefile.in:1.14
--- adns/client/Makefile.in:1.7	Thu Aug  5 01:03:18 1999
+++ adns/client/Makefile.in	Wed Oct 13 02:23:38 1999
@@ -1,6 +1,11 @@
 # client/Makefile - client program(s) Makefile
 # 
-#  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+#  This file is
+#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#
+#  It is part of adns, which is
+#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#    Copyright (C) 1999 Tony Finch <dot@dotat.at>
 #  
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -19,13 +24,20 @@
 srcdir=		@srcdir@
 VPATH=		@srcdir@
 
-TARG_LOCAL=	adnstest_s
-TARG_INSTALL=	adnstest
+PROGRAMS=	adnstest adnslogres adnshost
+TARG_INSTALL=	$(PROGRAMS)
+TARG_LOCAL=	$(addsuffix _s, $(PROGRAMS))
 TARGETS=	$(TARG_LOCAL) $(TARG_INSTALL)
 include		$(srcdir)/../settings.make
 
 DIRCFLAGS=	-I$(srcdir)/../src
 
+ADH_OBJS=	adh-main.o adh-opts.o adh-query.o
+
+STATIC_LIB=	$(srcdir)/../src/libadns.a
+DYNAMIC_DEP=	$(srcdir)/../dynamic/$(SHLIBFILE)
+DYNAMIC_LINK=	-L$(srcdir)/../dynamic -ladns
+
 all:		$(TARGETS)
 
 install:	$(TARG_INSTALL)
@@ -34,8 +46,17 @@
 
 uninstall:
 		for f in $(TARGETS); do rm -f $(bin_dir)/$$f; done
+
+$(ADH_OBJS):	adnshost.h
+
+adnshost:	$(ADH_OBJS) $(DYNAMIC_DEP)
+		$(CC) $(LDFLAGS) $(ADH_OBJS) $(DYNAMIC_LINK) -o $@ $(LDLIBS)
+
+adnshost_s:	$(ADH_OBJS) $(STATIC_LIB)
+		$(CC) $(LDFLAGS) $(ADH_OBJS) $(STATIC_LIB) -o $@ $(LDLIBS)
 
-adnstest:	adnstest.o $(srcdir)/../dynamic/$(SHLIBFILE)
+%:		%.o $(DYNAMIC_DEP)
+		$(CC) $(LDFLAGS) $< $(DYNAMIC_LINK) -o $@ $(LDLIBS)
 
-adnstest_s:	adnstest.o $(srcdir)/../src/libadns.a
-		$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS)
+%_s:		%.o $(STATIC_LIB)
+		$(CC) $(LDFLAGS) $< $(STATIC_LIB) -o $@ $(LDLIBS)
Index: adns/client/adh-main.c
diff -u /dev/null adns/client/adh-main.c:1.9
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/client/adh-main.c	Wed Oct 13 01:57:36 1999
@@ -0,0 +1,243 @@
+/*
+ * adh-main.c
+ * - useful general-purpose resolver client program
+ *   main program and useful subroutines
+ */
+/*
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *  
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software Foundation,
+ *  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
+ */
+
+#include "adnshost.h"
+
+void sysfail(const char *what, int errnoval) {
+  fprintf(stderr,"adnshost failed: %s: %s\n",what,strerror(errnoval));
+  exit(10);
+}
+
+void usageerr(const char *fmt, ...) {
+  va_list al;
+  fputs("adnshost usage error: ",stderr);
+  va_start(al,fmt);
+  vfprintf(stderr,fmt,al);
+  va_end(al);
+  putc('\n',stderr);
+  exit(11);
+}
+
+void outerr(void) {
+  sysfail("write to stdout",errno);
+}
+
+void *xmalloc(size_t sz) {
+  void *p;
+
+  p= malloc(sz); if (!p) sysfail("malloc",sz);
+  return p;
+}
+
+char *xstrsave(const char *str) {
+  char *p;
+  
+  p= xmalloc(strlen(str)+1);
+  strcpy(p,str);
+  return p;
+}
+
+void of_type(const struct optioninfo *oi, const char *arg) {
+  static const struct typename {
+    adns_rrtype type;
+    const char *desc;
+  } typenames[]= {
+    /* enhanced versions */
+    { adns_r_ns,     "ns"     },
+    { adns_r_soa,    "soa"    },
+    { adns_r_ptr,    "ptr"    },
+    { adns_r_mx,     "mx"     },
+    { adns_r_rp,     "rp"     },
+    { adns_r_addr,   "addr"   },
+    
+    /* types with only one version */
+    { adns_r_cname,  "cname"  },
+    { adns_r_hinfo,  "hinfo"  },
+    { adns_r_txt,    "txt"    },
+    
+    /* raw versions */
+    { adns_r_a,        "a"    },
+    { adns_r_ns_raw,   "ns-"  },
+    { adns_r_soa_raw,  "soa-" },
+    { adns_r_ptr_raw,  "ptr-" },
+    { adns_r_mx_raw,   "mx-"  },
+    { adns_r_rp_raw,   "rp-"  },
+
+    { adns_r_none, 0 }
+  };
+
+  const struct typename *tnp;
+
+  for (tnp=typenames;
+       tnp->type && strcmp(arg,tnp->desc);
+       tnp++);
+  if (!tnp->type) usageerr("unknown RR type %s",arg);
+  ov_type= tnp->type;
+}
+
+int rcode;
+
+static void process_optarg(const char *arg,
+			   const char *const **argv_p,
+			   const char *value) {
+  const struct optioninfo *oip;
+  int invert;
+
+  if (arg[0] == '-' || arg[0] == '+') {
+    if (arg[0] == '-' && arg[1] == '-') {
+      if (!strncmp(arg,"--no-",5)) {
+	invert= 1;
+	oip= opt_findl(arg+5);
+      } else {
+	invert= 0;
+	oip= opt_findl(arg+2);
+      }
+      if (oip->type == ot_funcarg) {
+	arg= argv_p ? *++(*argv_p) : value;
+	if (!arg) usageerr("option --%s requires a value argument",oip->lopt);
+      } else {
+	if (value) usageerr("option --%s does not take a value",oip->lopt);
+	arg= 0;
+      }
+      opt_do(oip,arg,invert);
+    } else if (arg[0] == '-' && arg[1] == 0) {
+      arg= argv_p ? *++(*argv_p) : value;
+      if (!arg) usageerr("option `-' must be followed by a domain");
+      query_do(arg);
+    } else { /* arg[1] != '-', != '\0' */
+      invert= (arg[0] == '+');
+      ++arg;
+      while (*arg) {
+	oip= opt_finds(&arg);
+	if (oip->type == ot_funcarg) {
+	  if (!*arg) {
+	    arg= argv_p ? *++(*argv_p) : value;
+	    if (!arg) usageerr("option -%s requires a value argument",oip->sopt);
+	  } else {
+	    if (value) usageerr("two values for option -%s given !",oip->sopt);
+	  }
+	  opt_do(oip,arg,invert);
+	  arg= "";
+	} else {
+	  if (value) usageerr("option -%s does not take a value",oip->sopt);
+	  opt_do(oip,0,invert);
+	}
+      }
+    }
+  } else { /* arg[0] != '-' */
+    query_do(arg);
+  }
+}
+    
+static void read_stdin(void) {
+  static int used, avail;
+  static char *buf;
+
+  int anydone, r;
+  char *newline, *space;
+
+  anydone= 0;
+  while (!anydone || used) {
+    while (!(newline= memchr(buf,'\n',used))) {
+      if (used == avail) {
+	avail += 20; avail <<= 1;
+	buf= realloc(buf,avail);
+	if (!buf) sysfail("realloc stdin buffer",errno);
+      }
+      do {
+	r= read(0,buf+used,avail-used);
+      } while (r < 0 && errno == EINTR);
+      if (r == 0) {
+	if (used) {
+	  /* fake up final newline */
+	  buf[used++]= '\n';
+	  r= 1;
+	} else {
+	  ov_pipe= 0;
+	  return;
+	}
+      }
+      if (r < 0) sysfail("read stdin",errno);
+      used += r;
+    }
+    *newline++= 0;
+    space= strchr(buf,' ');
+    if (space) *space++= 0;
+    process_optarg(buf,0,space);
+    used -= (newline-buf);
+    memmove(buf,newline,used);
+    anydone= 1;
+  }
+}
+
+int main(int argc, const char *const *argv) {
+  struct timeval *tv, tvbuf;
+  adns_query qu;
+  void *qun_v;
+  adns_answer *answer;
+  int r, maxfd;
+  fd_set readfds, writefds, exceptfds;
+  const char *arg;
+  
+  while ((arg= *++argv)) process_optarg(arg,&argv,0);
+
+  if (!ov_pipe && !ads) usageerr("no domains given, and -f/--pipe not used; try --help");
+
+  ensure_adns_init();
+
+  for (;;) {
+    for (;;) {
+      qu= ov_asynch ? 0 : outstanding.head ? outstanding.head->qu : 0;
+      r= adns_check(ads,&qu,&answer,&qun_v);
+      if (r == EAGAIN) break;
+      if (r == ESRCH) { if (!ov_pipe) goto x_quit; else break; }
+      assert(!r);
+      query_done(qun_v,answer);
+    }
+    maxfd= 0;
+    FD_ZERO(&readfds);
+    FD_ZERO(&writefds);
+    FD_ZERO(&exceptfds);
+    if (ov_pipe) {
+      maxfd= 1;
+      FD_SET(0,&readfds);
+    }
+    tv= 0;
+    adns_beforeselect(ads, &maxfd, &readfds,&writefds,&exceptfds, &tv,&tvbuf,0);
+    r= select(maxfd, &readfds,&writefds,&exceptfds, tv);
+    if (r == -1) {
+      if (errno == EINTR) continue;
+      sysfail("select",errno);
+    }
+    adns_afterselect(ads, maxfd, &readfds,&writefds,&exceptfds, 0);
+    if (ov_pipe && FD_ISSET(0,&readfds)) read_stdin();
+  }
+x_quit:
+  if (fclose(stdout)) outerr();
+  exit(rcode);
+}
Index: adns/client/adh-opts.c
diff -u /dev/null adns/client/adh-opts.c:1.8
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/client/adh-opts.c	Wed Oct 13 01:57:36 1999
@@ -0,0 +1,326 @@
+/*
+ * adh-opts.c
+ * - useful general-purpose resolver client program
+ *   option handling tables etc.
+ */
+/*
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *  
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software Foundation,
+ *  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
+ */
+
+#include "adnshost.h"
+
+int ov_env=1, ov_pipe=0, ov_asynch=0;
+int ov_verbose= 0;
+adns_rrtype ov_type= adns_r_none;
+int ov_search=0, ov_qc_query=0, ov_qc_anshost=0, ov_qc_cname=1;
+int ov_tcp=0, ov_cname=0;
+char *ov_id= 0;
+struct perqueryflags_remember ov_pqfr = { 1,1,1, tm_none };
+
+static const struct optioninfo global_options[]= {
+  { ot_desconly, "global binary options:" },
+  { ot_flag,             "Do not look at environment variables at all",
+    "e", "env",            &ov_env, 0 },
+  { ot_flag,             "Read queries on stdin instead of using args",
+    "f", "pipe",           &ov_pipe, 1 },
+  { ot_flag,             "Allow answers to be reordered",
+    "a", "asynch",         &ov_asynch, 1 },
+  		         
+  { ot_desconly, "global verbosity level:" },
+  { ot_value,            "Do not print anything to stderr",
+    "Vq", "quiet",         &ov_verbose, adns_if_noerrprint },
+  { ot_value,            "Report unexpected kinds of problem only  (default)",
+    "Vn", "no-quiet",      &ov_verbose, 0 },
+  { ot_value,            "Debugging mode",
+    "Vd", "debug",         &ov_verbose, adns_if_debug },
+  		         
+  { ot_desconly, "other global options:" },
+  { ot_func,             "Print usage information",
+    0, "help",             0,0, of_help },
+
+  { ot_end }
+};
+
+static const struct optioninfo perquery_options[]= {
+  { ot_desconly, "per-query options:" },
+  { ot_funcarg,          "Query type (see below)",
+    "t", "type",           0,0, &of_type, "type" },
+  { ot_funcarg,          "Do reverse query (address -> name lookup)",
+    "i", "ptr",            0,0, &of_ptr, "addr" },
+
+  { ot_desconly, "per-query binary options:" },
+  { ot_flag,             "Use the search list",
+    "s", "search",         &ov_search, 1 },
+  { ot_flag,             "Let query domains contain quote-requiring chars",
+    "Qq", "qc-query",      &ov_qc_query, 1 },
+  { ot_flag,             "Let hostnames in answers contain ...",
+    "Qa", "qc-anshost",    &ov_qc_anshost, 1 },
+  { ot_flag,             "Prevent CNAME target domains from containing ...",
+    "Qc", "qc-cname",      &ov_qc_cname, 0 },
+  { ot_flag,             "Force use of a virtual circuit",
+    "u", "tcp",            &ov_tcp, 1 },
+  { ot_flag,             "Do not display owner name in output",
+    "Do", "show-owner",   &ov_pqfr.show_owner, 0 },
+  { ot_flag,             "Do not display RR type in output",
+    "Dt", "show-type",    &ov_pqfr.show_type, 0 },
+  { ot_flag,             "Do not display CNAME target in output",
+    "Dc", "show-cname",    &ov_pqfr.show_cname, 0 },
+  
+  { ot_desconly, "per-query TTL mode (NB TTL is minimum across all info in reply):" },
+  { ot_value,            "Show the TTL as a TTL",
+    "Tt", "ttl-ttl",       &ov_pqfr.ttl, tm_rel },
+  { ot_value,            "Show the TTL as a time_t when the data might expire",
+    "Ta", "ttl-abs",       &ov_pqfr.ttl, tm_abs },
+  { ot_value,            "Do not show the TTL (default)",
+    "Tn", "no-ttl",        &ov_pqfr.ttl, tm_none },
+  
+  { ot_desconly, "per-query CNAME handling mode:" },
+  { ot_value,            "Call it an error if a CNAME is found",
+    "Cf", "cname-reject",  &ov_cname, adns_qf_cname_forbid },
+  { ot_value,            "Allow references to CNAMEs in other RRs",
+    "Cl", "cname-loose",   &ov_cname, adns_qf_cname_loose },
+  { ot_value,            "CNAME ok for query domain, but not in RRs (default)",
+    "Cs", "cname-ok",      &ov_cname, 0 },
+  
+  { ot_desconly, "asynchronous/pipe mode options:" },
+  { ot_funcarg,          "Set <id>, default is decimal sequence starting 0",
+    0, "asynch-id",        0,0, &of_asynch_id, "id" },
+  { ot_funcarg,          "Cancel the query with id <id> (no error if not found)",
+    0, "cancel-id",        0,0, &of_cancel_id, "id" },
+
+  { ot_end }
+};
+
+static void printusage(void) {
+  static const struct optioninfo *const all_optiontables[]= {
+    global_options, perquery_options, 0
+  };
+
+  const struct optioninfo *const *oiap, *oip=0;
+  int maxsopt, maxlopt, l;
+
+  maxsopt= maxlopt= 0;
+  
+  for (oiap=all_optiontables; *oiap; oiap++) {
+    for (oip=*oiap; oip->type != ot_end; oip++) {
+      if (oip->type == ot_funcarg) continue;
+      if (oip->sopt) { l= strlen(oip->sopt); if (l>maxsopt) maxsopt= l; }
+      if (oip->lopt) {
+	l= strlen(oip->lopt);
+	if (oip->type == ot_flag && !oip->value) l+= 3;
+	if (l>maxlopt) maxlopt= l;
+      }
+    }
+  }
+	
+  fputs("usage: adnshost [global-opts] [query-opts] query-domain\n"
+	"                             [[query-opts] query-domain ...]\n"
+	"       adnshost [global-opts] [query-opts] -f|--pipe\n",
+	stdout);
+
+  for (oiap=all_optiontables; *oiap; oiap++) {
+    putchar('\n');
+    for (oip=*oiap; oip->type != ot_end; oip++) {
+      switch (oip->type) {
+      case ot_flag:
+	if (!oip->value) {
+	  if (oip->sopt) {
+	    printf(" +%-*s --no-%-*s %s\n",
+		   maxsopt, oip->sopt,
+		   maxlopt-2, oip->lopt,
+		   oip->desc);
+	  } else {
+	    printf(" --no-%-*s %s\n",
+		   maxlopt+maxsopt+1, oip->lopt,
+		   oip->desc);
+	  }
+	  break;
+	}
+      case ot_value: case ot_func: /* fall through */
+	if (oip->sopt) {
+	  printf(" -%-*s --%-*s %s\n",
+		 maxsopt, oip->sopt,
+		 maxlopt+1, oip->lopt,
+		 oip->desc);
+	} else {
+	  printf(" --%-*s %s\n",
+		 maxlopt+maxsopt+3, oip->lopt,
+		 oip->desc);
+	}
+	break;
+      case ot_funcarg:
+	if (oip->sopt) {
+	  l= (maxlopt + maxsopt - 9 -
+	      (strlen(oip->sopt) + strlen(oip->lopt) + 2*strlen(oip->argdesc)));
+	  printf(" -%s<%s> / --%s <%s>%*s%s\n",
+		 oip->sopt, oip->argdesc, oip->lopt, oip->argdesc,
+		 l>2 ? l : 2, "",
+		 oip->desc);
+	} else {
+	  l= (maxlopt + maxsopt + 1 -
+	      (strlen(oip->lopt) + strlen(oip->argdesc)));
+	  printf(" --%s <%s>%*s%s\n",
+		 oip->lopt, oip->argdesc,
+		 l>2 ? l : 2, "",
+		 oip->desc);
+	}
+	break;
+      case ot_desconly:
+	printf("%s\n", oip->desc);
+	break;
+      default:
+	abort();
+      }
+    }
+  }
+
+  printf("\nEscaping domains which might start with `-':\n"
+	 " - %-*s Next argument is a domain, but more options may follow\n",
+	 maxlopt+maxsopt+3, "<domain>");
+  
+  fputs("\n"
+	"Query domains should always be quoted according to master file format.\n"
+	"\n"
+	"For binary options, --FOO and --no-FOO are opposites, as are\n"
+	"-X and +X.  In each case the default is the one not listed.\n"
+	"Per query options stay set a particular way until they are reset,\n"
+	"whether they appear on the command line or on stdin.\n"
+	"All global options must preceed the first query domain.\n"
+	"\n"
+	"With -f, the input should be lines with either an option, possibly\n"
+	"with a value argument (separated from the option by a space if it's a long\n"
+	"option), or a domain (possibly preceded by a hyphen and a space to\n"
+	"distinguish it from an option).\n"
+	"\n"
+	"Output format is master file format without class or TTL by default:\n"
+	"   [<owner>] [<ttl>] [<type>] <data>\n"
+	"or if the <owner> domain refers to a CNAME and --show-cname is on\n"
+	"   [<owner>] [<ttl>] CNAME <cname>\n"
+	"   [<cname>] [<ttl>] <type> <data>\n"
+	"When a query fails you get a line like this (broken here for readability):\n"
+	"   ; failed <statustype> <statusnum> <statusabbrev> \\\n"
+	"       [<owner>] [<ttl>] [<cname>] \"<status string>\"\n"
+	"\n"
+	"If you use --asynch each answer (success or failure) is preceded by a line\n"
+	"   <id> <nrrs> <statustype> <statusnum> <statusabbrev> \\\n"
+	"       [<owner>] [<ttl>] [<cname>] \"<status string>\"\n"
+	"where <nrrs> is the number of RRs that follow and <cname> will be `$' or\n"
+	"the CNAME target; the CNAME indirection and error formats above are not used.\n"
+	"\n"
+	"Exit status:\n"
+	" 0    all went well\n"
+	" 1-6  at least one query failed with statustype:\n"
+	"   1    localfail   )\n"
+	"   2    remotefail  ) temporary errors\n"
+	"   3    tempfail  __)_________________\n"
+	"   4    misconfig   )\n"
+	"   5    misquery    ) permanent errors\n"
+	"   6    permfail    )\n"
+	" 10   system trouble\n"
+	" 11   usage problems\n"
+	"\n"
+	"Query types (see adns.h; default is addr):\n"
+	"  ns  soa  ptr  mx  rp  addr       - enhanced versions\n"
+	"  cname  hinfo  txt                - types with only one version\n"
+	"  a  ns-  soa-  ptr-  mx-  rp-     - _raw versions\n"
+	"Default is addr, or ptr for -i/--ptr queries\n",
+	stdout);
+  if (ferror(stdout)) sysfail("write usage message",errno);
+}
+
+void of_help(const struct optioninfo *oi, const char *arg) {
+  printusage();
+  if (fclose(stdout)) sysfail("finish writing output",errno);
+  exit(0);
+}
+
+typedef int comparer_type(const char **optp, const struct optioninfo *entry);
+
+static int oc_long(const char **optp, const struct optioninfo *entry) {
+  return entry->lopt && !strcmp(*optp,entry->lopt);
+}
+
+static int oc_short(const char **optp, const struct optioninfo *entry) {
+  const char *sopt;
+  int l;
+
+  sopt= entry->sopt;
+  if (!sopt) return 0;
+  l= strlen(sopt);
+  if (memcmp(*optp,sopt,l)) return 0;
+  (*optp) += l;
+  return 1;
+}
+
+static const struct optioninfo *find1(const char **optp,
+				      const struct optioninfo *table,
+				      comparer_type *comparer) {
+  for (;;) {
+    if (table->type == ot_end) return 0;
+    if (comparer(optp,table)) return table;
+    table++;
+  }
+}
+
+static const struct optioninfo *find(const char **optp,
+				     const char *prefix,
+				     comparer_type *comparer) {
+  const struct optioninfo *oip;
+
+  oip= find1(optp,perquery_options,comparer);
+  if (oip) return oip;
+  oip= find1(optp,global_options,comparer);
+  if (!oip) usageerr("unknown option %s%s",prefix,*optp);
+  if (ads) usageerr("global option %s%s specified after query domain(s)",prefix,*optp);
+  return oip;
+}
+
+const struct optioninfo *opt_findl(const char *opt) { return find(&opt,"--",oc_long); }
+const struct optioninfo *opt_finds(const char **optp) { return find(optp,"-",oc_short); }
+
+static void noninvert(const struct optioninfo *oip) NONRETURNING;
+static void noninvert(const struct optioninfo *oip) {
+  usageerr("option %s%s%s%s%s may not be inverted",
+	   oip->sopt ? "-" : "", oip->sopt ? oip->sopt : "",
+	   oip->lopt && oip->sopt ? " / " : "",
+	   oip->lopt ? "--" : "", oip->lopt ? oip->lopt : "");
+}
+
+void opt_do(const struct optioninfo *oip, const char *arg, int invert) {
+  switch (oip->type) {
+  case ot_flag:
+    assert(!arg);
+    *oip->storep= !invert;
+    return;
+  case ot_value:
+    assert(!arg);
+    if (invert) noninvert(oip);
+    *oip->storep= oip->value;
+    return;
+  case ot_func: case ot_funcarg:
+    if (invert) noninvert(oip);
+    oip->func(oip,arg);
+    return;
+  default:
+    abort();
+  }
+}
Index: adns/client/adh-query.c
diff -u /dev/null adns/client/adh-query.c:1.8
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/client/adh-query.c	Wed Oct 13 01:57:36 1999
@@ -0,0 +1,239 @@
+/*
+ * adh-query.c
+ * - useful general-purpose resolver client program
+ *   make queries and print answers
+ */
+/*
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *  
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software Foundation,
+ *  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
+ */
+
+#include "adnshost.h"
+
+adns_state ads;
+struct outstanding_list outstanding;
+
+static unsigned long idcounter;
+
+void ensure_adns_init(void) {
+  int r;
+  
+  if (ads) return;
+
+  if (signal(SIGPIPE,SIG_IGN) == SIG_ERR) sysfail("ignore SIGPIPE",errno);
+  r= adns_init(&ads,
+	       adns_if_noautosys|adns_if_nosigpipe |
+	       (ov_env ? 0 : adns_if_noenv) |
+	       ov_verbose,
+	       0);
+  if (r) sysfail("adns_init",r);
+}
+
+static void prep_query(struct query_node **qun_r, int *quflags_r) {
+  struct query_node *qun;
+  char idbuf[20];
+  
+  if (ov_pipe && !ads) usageerr("-f/--pipe not consistent with domains on command line");
+  ensure_adns_init();
+  
+  qun= malloc(sizeof(*qun));
+  qun->pqfr= ov_pqfr;
+  if (ov_id) {
+    qun->id= xstrsave(ov_id);
+  } else {
+    sprintf(idbuf,"%lu",idcounter++);
+    idcounter &= 0x0fffffffflu;
+    qun->id= xstrsave(idbuf);
+  }
+
+  *quflags_r=
+    (ov_search ? adns_qf_search : 0) |
+    (ov_tcp ? adns_qf_usevc : 0) |
+    (ov_pqfr.show_owner ? adns_qf_owner : 0) |
+    (ov_qc_query ? adns_qf_quoteok_query : 0) |
+    (ov_qc_anshost ? adns_qf_quoteok_anshost : 0) |
+    (ov_qc_cname ? 0 : adns_qf_quoteok_cname) |
+    ov_cname,
+    
+  *qun_r= qun;
+}
+  
+void of_ptr(const struct optioninfo *oi, const char *arg) {
+  struct query_node *qun;
+  int quflags, r;
+  struct sockaddr_in sa;
+
+  memset(&sa,0,sizeof(sa));
+  sa.sin_family= AF_INET;
+  if (!inet_aton(arg,&sa.sin_addr)) usageerr("invalid IP address %s",arg);
+
+  prep_query(&qun,&quflags);
+  r= adns_submit_reverse(ads,
+			 (struct sockaddr*)&sa,
+			 ov_type == adns_r_none ? adns_r_ptr : ov_type,
+			 quflags,
+			 qun,
+			 &qun->qu);
+  if (r) sysfail("adns_submit_reverse",r);
+
+  LIST_LINK_TAIL(outstanding,qun);
+}
+
+void query_do(const char *domain) {
+  struct query_node *qun;
+  int quflags, r;
+
+  prep_query(&qun,&quflags);
+  r= adns_submit(ads, domain,
+		 ov_type == adns_r_none ? adns_r_addr : ov_type,
+		 quflags,
+		 qun,
+		 &qun->qu);
+  if (r) sysfail("adns_submit",r);
+
+  LIST_LINK_TAIL(outstanding,qun);
+}
+
+static void dequeue_query(struct query_node *qun) {
+  LIST_UNLINK(outstanding,qun);
+  free(qun->id);
+  free(qun);
+}
+
+static void print_withspace(const char *str) {
+  if (printf("%s ", str) == EOF) outerr();
+}
+
+static void print_ttl(struct query_node *qun, adns_answer *answer) {
+  unsigned long ttl;
+  time_t now;
+  
+  switch (qun->pqfr.ttl) {
+  case tm_none:
+    return;
+  case tm_rel:
+    if (time(&now) == (time_t)-1) sysfail("get current time",errno);
+    ttl= answer->expires < now ? 0 : answer->expires - now;
+    break;
+  case tm_abs:
+    ttl= answer->expires;
+    break;
+  default:
+    abort();
+  }
+  if (printf("%lu ",ttl) == EOF) outerr();
+}
+
+static void print_owner_ttl(struct query_node *qun, adns_answer *answer) {
+  if (qun->pqfr.show_owner) print_withspace(answer->owner);
+  print_ttl(qun,answer);
+}
+
+static void print_status(adns_status st, struct query_node *qun, adns_answer *answer) {
+  static const adns_status statuspoints[]= {
+    adns_s_ok,
+    adns_s_max_localfail, adns_s_max_remotefail, adns_s_max_tempfail,
+    adns_s_max_misconfig, adns_s_max_misquery
+  };
+
+  const adns_status *spp;
+  const char *statustypeabbrev, *statusabbrev, *statusstring;
+  int minrcode;
+
+  statustypeabbrev= adns_errtypeabbrev(st);
+  for (minrcode=0, spp=statuspoints;
+       spp < statuspoints + (sizeof(statuspoints)/sizeof(statuspoints[0]));
+       spp++)
+    if (st > *spp) minrcode++;
+  if (rcode < minrcode) rcode= minrcode;
+
+  statusabbrev= adns_errabbrev(st);
+  statusstring= adns_strerror(st);
+  assert(!strchr(statusstring,'"'));
+
+  if (printf("%s %d %s ", statustypeabbrev, st, statusabbrev)
+      == EOF) outerr();
+  print_owner_ttl(qun,answer);
+  if (qun->pqfr.show_cname)
+    print_withspace(answer->cname ? answer->cname : "$");
+  if (printf("\"%s\"\n", statusstring) == EOF) outerr();
+}
+
+void query_done(struct query_node *qun, adns_answer *answer) {
+  adns_status st, ist;
+  int rrn, nrrs;
+  const char *rrp, *realowner, *typename;
+  char *datastr;
+
+  st= answer->status;
+  nrrs= answer->nrrs;
+  if (ov_asynch) {
+    if (printf("%s %d ", qun->id, nrrs) == EOF) outerr();
+    print_status(st,qun,answer);
+  } else {
+    if (st) {
+      if (fputs("; failed ",stdout) == EOF) outerr();
+      print_status(st,qun,answer);
+    } else if (qun->pqfr.show_cname && answer->cname) {
+      print_owner_ttl(qun,answer);
+      if (printf("CNAME %s\n",answer->cname) == EOF) outerr();
+    }
+  }
+  if (qun->pqfr.show_owner) {
+    realowner= answer->cname ? answer->cname : answer->owner;;
+    assert(realowner);
+  } else {
+    realowner= 0;
+  }
+  if (nrrs) {
+    for (rrn=0, rrp = answer->rrs.untyped;
+	 rrn < nrrs;
+	 rrn++, rrp += answer->rrsz) {
+      if (realowner) print_withspace(realowner);
+      print_ttl(qun,answer);
+      ist= adns_rr_info(answer->type, &typename, 0, 0, rrp, &datastr);
+      if (ist == adns_s_nomemory) sysfail("adns_rr_info failed",ENOMEM);
+      assert(!ist);
+      if (qun->pqfr.show_type) print_withspace(typename);
+      if (printf("%s\n",datastr) == EOF) outerr();
+      free(datastr);
+    }
+  }
+  if (fflush(stdout)) outerr();
+  free(answer);
+  dequeue_query(qun);
+}
+
+void of_asynch_id(const struct optioninfo *oi, const char *arg) {
+  free(ov_id);
+  ov_id= xstrsave(arg);
+}
+
+void of_cancel_id(const struct optioninfo *oi, const char *arg) {
+  struct query_node *qun;
+
+  for (qun= outstanding.head;
+       qun && strcmp(qun->id,arg);
+       qun= qun->next);
+  if (!qun) return;
+  adns_cancel(qun->qu);
+  dequeue_query(qun);
+}
Index: adns/client/adnshost.h
diff -u /dev/null adns/client/adnshost.h:1.6
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/client/adnshost.h	Wed Oct 13 01:57:36 1999
@@ -0,0 +1,115 @@
+/*
+ * adnshost.h
+ * - useful general-purpose resolver client program, header file
+ */
+/*
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *  
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software Foundation,
+ *  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
+ */
+
+#ifndef ADNSHOST_H_INCLUDED
+#define ADNSHOST_H_INCLUDED
+
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <signal.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "config.h"
+#include "adns.h"
+#include "dlist.h"
+
+/* declarations related to option processing */
+
+struct optioninfo;
+typedef void optfunc(const struct optioninfo *oi, const char *arg);
+
+struct optioninfo {
+  enum oi_type {
+    ot_end, ot_desconly,
+    ot_flag, ot_value, ot_func, ot_funcarg
+  } type;
+  const char *desc;
+  const char *sopt, *lopt;
+  int *storep, value;
+  optfunc *func;
+  const char *argdesc;
+};
+
+enum ttlmode { tm_none, tm_rel, tm_abs };
+
+struct perqueryflags_remember {
+  int show_owner, show_type, show_cname;
+  int ttl;
+};
+
+extern int ov_env, ov_pipe, ov_asynch;
+extern int ov_verbose;
+extern adns_rrtype ov_type;
+extern int ov_search, ov_qc_query, ov_qc_anshost, ov_qc_cname;
+extern int ov_tcp, ov_cname;
+extern char *ov_id;
+extern struct perqueryflags_remember ov_pqfr;
+
+extern optfunc of_help, of_type, of_ptr, of_asynch_id, of_cancel_id;
+
+const struct optioninfo *opt_findl(const char *opt);
+const struct optioninfo *opt_finds(const char **optp);
+void opt_do(const struct optioninfo *oip, const char *arg, int invert);
+
+/* declarations related to query processing */
+
+struct query_node {
+  struct query_node *next, *back;
+  struct perqueryflags_remember pqfr;
+  char *id;
+  adns_query qu;
+};
+
+extern adns_state ads;
+extern struct outstanding_list { struct query_node *head, *tail; } outstanding;
+
+void ensure_adns_init(void);
+void query_do(const char *domain);
+void query_done(struct query_node *qun, adns_answer *answer);
+
+void of_asynch_id(const struct optioninfo *oi, const char *arg);
+void of_cancel_id(const struct optioninfo *oi, const char *arg);
+
+/* declarations related to main program and useful utility functions */
+
+void sysfail(const char *what, int errnoval) NONRETURNING;
+void usageerr(const char *what, ...) NONRETURNPRINTFFORMAT(1,2);
+void outerr(void) NONRETURNING;
+
+void *xmalloc(size_t sz);
+char *xstrsave(const char *str);
+
+extern int rcode;
+
+#endif
Index: adns/client/adnslogres.c
diff -u /dev/null adns/client/adnslogres.c:1.5
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/client/adnslogres.c	Tue Oct 12 23:56:16 1999
@@ -0,0 +1,207 @@
+/*
+ * adnslogres.c
+ * - a replacement for the Apache logresolve program using adns
+ */
+/*
+ *  This file is
+ *   Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *   Copyright (C) 1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *  
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software Foundation,
+ *  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * This version was originally supplied by Tony Finch, but has been
+ * modified by Ian Jackson as it was incorporated into adns.
+ */
+
+static const char * const cvsid =
+	"$Id: adnslogres.c,v 1.5 1999/10/12 22:56:16 ian Exp $";
+
+#include <sys/types.h>
+#include <sys/time.h>
+
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <errno.h>
+
+#include "adns.h"
+
+/* maximum number of concurrent DNS queries */
+#define MAXPENDING 1000
+
+/* maximum length of a line */
+#define MAXLINE 1024
+
+/* option flags */
+#define OPT_DEBUG 1
+#define OPT_POLL 2
+
+static const char *progname;
+
+static void aargh(const char *msg) {
+  fprintf(stderr, "%s: %s: %s (%d)\n", progname, msg,
+	  strerror(errno) ? strerror(errno) : "Unknown error", errno);
+  exit(1);
+}
+
+/*
+ * Parse the IP address and convert to a reverse domain name.
+ */
+static char *ipaddr2domain(char *start, char **addr, char **rest) {
+  static char buf[30]; /* "123.123.123.123.in-addr.arpa.\0" */
+  char *ptrs[5];
+  int i;
+
+  ptrs[0]= start;
+retry:
+  while (!isdigit(*ptrs[0]))
+    if (!*ptrs[0]++) {
+      strcpy(buf, "invalid.");
+      *addr= *rest= NULL;
+      return buf;
+    }
+  for (i= 1; i < 5; i ++) {
+    ptrs[i]= strchr(ptrs[i-1], (i == 4) ? ' ' : '.');
+    if (!ptrs[i] || ptrs[i]-ptrs[i-1] > 3) {
+      ptrs[0]++;
+      goto retry;
+    } else
+      ptrs[i]++;
+  }
+  sprintf(buf, "%.*s.%.*s.%.*s.%.*s.in-addr.arpa.",
+	  ptrs[4]-ptrs[3]-1, ptrs[3],
+	  ptrs[3]-ptrs[2]-1, ptrs[2],
+	  ptrs[2]-ptrs[1]-1, ptrs[1],
+	  ptrs[1]-ptrs[0]-1, ptrs[0]);
+  *addr= ptrs[0];
+  *rest= ptrs[4]-1;
+  return buf;
+}
+
+static void printline(char *start, char *addr, char *rest, char *domain) {
+  if (domain)
+    printf("%.*s%s%s", addr - start, start, domain, rest);
+  else
+    fputs(start, stdout);
+  if (ferror(stdout)) aargh("write output");
+}
+
+typedef struct logline {
+  struct logline *next;
+  char *start, *addr, *rest;
+  adns_query query;
+} logline;
+
+static logline *readline(adns_state adns, int opts) {
+  static char buf[MAXLINE];
+  char *str;
+  logline *line;
+
+  if (fgets(buf, MAXLINE, stdin)) {
+    str= malloc(sizeof(*line) + strlen(buf) + 1);
+    if (!str) aargh("malloc");
+    line= (logline*)str;
+    line->next= NULL;
+    line->start= str+sizeof(logline);
+    strcpy(line->start, buf);
+    str = ipaddr2domain(line->start, &line->addr, &line->rest);
+    if (opts & OPT_DEBUG)
+	fprintf(stderr, "%s: adns_submit %s\n", progname, str);
+    if (adns_submit(adns, str, adns_r_ptr,
+		    adns_qf_quoteok_cname|adns_qf_cname_loose,
+		    NULL, &line->query))
+      aargh("adns_submit");
+    return line;
+  }
+  if (!feof(stdin))
+    aargh("fgets");
+  return NULL;
+}
+	
+static void proclog(int opts) {
+  int eof, err, len;
+  adns_state adns;
+  adns_answer *answer;
+  logline *head, *tail, *line;
+
+  errno= adns_init(&adns, (opts & OPT_DEBUG) ? adns_if_debug : 0, 0);
+  if (errno) aargh("adns_init");
+  head= tail= readline(adns, opts);
+  len= 1; eof= 0;
+  while (head) {
+    if (eof || len > MAXPENDING)
+      if (opts & OPT_POLL)
+	err= adns_wait_poll(adns, &head->query, &answer, NULL);
+      else
+	err= adns_wait(adns, &head->query, &answer, NULL);
+    else
+      err= adns_check(adns, &head->query, &answer, NULL);
+    if (err != EAGAIN) {
+	printline(head->start, head->addr, head->rest,
+		  answer->status == adns_s_ok ? *answer->rrs.str : NULL);
+	line= head; head= head->next;
+	free(line); free(answer);
+	len--;
+    }
+    if (!eof) {
+      line= readline(adns, opts);
+      if (!line)
+	eof= 1;
+      else {
+	if (!head)
+	  head = line;
+	else
+	  tail->next = line;
+	tail = line;
+	len++;
+      }
+    }
+  }
+  adns_finish(adns);
+}
+
+int main(int argc, char *argv[]) {
+  int c, opts;
+
+  progname= *argv;
+  opts= 0;
+
+  while ((c= getopt(argc, argv, "dp")) != -1) {
+    switch (c) {
+    case 'd':
+      opts |= OPT_DEBUG;
+      break;
+    case 'p':
+      opts |= OPT_POLL;
+      break;
+    default:
+      fprintf(stderr, "usage: %s [-d] < logfile\n", progname);
+      exit(1);
+    }
+    argc-= optind;
+    argv+= optind;
+  }
+
+  proclog(opts);
+
+  if (fclose(stdout)) aargh("finish writing output");
+  return 0;
+}
Index: adns/client/adnstest.c
diff -u adns/client/adnstest.c:1.32 adns/client/adnstest.c:1.38
--- adns/client/adnstest.c:1.32	Thu Aug  5 01:03:19 1999
+++ adns/client/adnstest.c	Sun Oct 10 14:16:24 1999
@@ -1,9 +1,14 @@
 /*
- * dtest.c
+ * adnstest.c
  * - simple test program, not part of the library
  */
 /*
- *  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
  *  
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -40,23 +45,43 @@
 #undef poll
 int poll(struct pollfd *ufds, int nfds, int timeout) {
   fputs("poll(2) not supported on this system\n",stderr);
-  exit(3);
+  exit(5);
 }
 #define adns_beforepoll(a,b,c,d,e) 0
 #define adns_afterpoll(a,b,c,d) 0
 #endif
 
+static void failure_status(const char *what, adns_status st) NONRETURNING;
 static void failure_status(const char *what, adns_status st) {
   fprintf(stderr,"adns failure: %s: %s\n",what,adns_strerror(st));
   exit(2);
 }
 
+static void failure_errno(const char *what, int errnoval) NONRETURNING;
 static void failure_errno(const char *what, int errnoval) {
   fprintf(stderr,"adns failure: %s: errno=%d\n",what,errnoval);
   exit(2);
 }
 
-static const char *defaultargv[]= { "ns.chiark.greenend.org.uk", 0 };
+static void usageerr(const char *why) NONRETURNING;
+static void usageerr(const char *why) {
+  fprintf(stderr,
+	  "bad usage: %s\n"
+	  "usage: adnstest [-<initflagsnum>[,<owninitflags>]] [/<initstring>]\n"
+	  "              [ :<typenum>,... ]\n"
+	  "              [ [<queryflagsnum>[,<ownqueryflags>]/]<domain> ... ]\n"
+	  "initflags:   p  use poll(2) instead of select(2)\n"
+	  "             s  use adns_wait with specified query, instead of 0\n"
+	  "queryflags:  a  print status abbrevs instead of strings\n"
+	  "exit status:  0 ok (though some queries may have failed)\n"
+	  "              1 used by test harness to indicate test failed\n"
+	  "              2 unable to submit or init or some such\n"
+	  "              3 unexpected failure\n"
+	  "              4 usage error\n"
+	  "              5 operation not supported on this system\n",
+	  why);
+  exit(4);
+}
 
 static const adns_rrtype defaulttypes[]= {
   adns_r_a,
@@ -123,8 +148,7 @@
   const char *initstring, *rrtn, *fmtn;
   const char *const *fdomlist, *domain;
   char *show, *cp;
-  int len, i, qc, qi, tc, ti, ch, qflags, initflagsnum, npollfds, npollfdsavail, timeout;
-  struct pollfd *pollfds;
+  int len, i, qc, qi, tc, ti, ch, qflags, initflagsnum;
   adns_status ri;
   int r;
   const adns_rrtype *types;
@@ -150,15 +174,11 @@
   initflagsnum= strtoul(initflags,&ep,0);
   if (*ep == ',') {
     owninitflags= ep+1;
-    if (!consistsof(owninitflags,"ps")) {
-      fputs("unknown owninitflag\n",stderr);
-      exit(4);
-    }
+    if (!consistsof(owninitflags,"ps")) usageerr("unknown owninitflag");
   } else if (!*ep) {
     owninitflags= "";
   } else {
-    fputs("bad <initflagsnum>[,<owninitflags>]\n",stderr);
-    exit(4);
+    usageerr("bad <initflagsnum>[,<owninitflags>]");
   }
   
   if (argv[0] && argv[1] && argv[1][0] == ':') {
@@ -169,16 +189,7 @@
     for (cp= argv[1]+1, ti=0; ti<tc; ti++) {
       types_a[ti]= strtoul(cp,&cp,10);
       if ((ch= *cp)) {
-	if (ch != ',') {
-	  fputs("usage: adnstest [-<initflagsnum>[,<owninitflags>]] [/<initstring>]\n"
-		"              [ :<typenum>,... ]\n"
-		"              [ [<queryflagsnum>[,<ownqueryflags>]/]<domain> ... ]\n"
-		"initflags:   p  use poll(2) instead of select(2)\n"
-		"             s  use adns_wait with specified query, instead of 0\n"
-		"queryflags:  a  print status abbrevs instead of strings\n",
-		stderr);
-	  exit(4);
-	}
+	if (ch != ',') usageerr("unexpected char (not comma) in or between types");
 	cp++;
       }
     }
@@ -189,8 +200,8 @@
     types= defaulttypes;
   }
   
-  if (argv[0] && argv[1]) fdomlist= (const char *const*)argv+1;
-  else fdomlist= defaultargv;
+  if (!(argv[0] && argv[1])) usageerr("no query domains supplied");
+  fdomlist= (const char *const*)argv+1;
 
   for (qc=0; fdomlist[qc]; qc++);
   for (tc=0; types[tc] != adns_r_none; tc++);
@@ -199,7 +210,8 @@
 
   if (initstring) {
     r= adns_init_strcfg(&ads,
-			(adns_if_debug|adns_if_noautosys)^initflagsnum,
+			(adns_if_debug|adns_if_noautosys|adns_if_checkc_freq)
+			^initflagsnum,
 			stdout,initstring);
   } else {
     r= adns_init(&ads,
@@ -208,15 +220,9 @@
   }
   if (r) failure_errno("init",r);
 
-  npollfdsavail= 0;
-  pollfds= 0;
-  
   for (qi=0; qi<qc; qi++) {
     fdom_split(fdomlist[qi],&domain,&qflags,ownflags,sizeof(ownflags));
-    if (!consistsof(ownflags,"a")) {
-      fputs("unknown ownqueryflag\n",stderr);
-      exit(4);
-    }
+    if (!consistsof(ownflags,"a")) usageerr("unknown ownqueryflag");
     for (ti=0; ti<tc; ti++) {
       mc= &mcs[qi*tc+ti];
       mc->doneyet= 0;
@@ -274,23 +280,7 @@
     }
 
     if (strchr(owninitflags,'p')) {
-      for (;;) {
-	r= adns_check(ads,&qu,&ans,&mcr);
-	if (r != EWOULDBLOCK) break;
-	for (;;) {
-	  npollfds= npollfdsavail;
-	  timeout= -1;
-	  r= adns_beforepoll(ads, pollfds, &npollfds, &timeout, 0);
-	  if (r != ERANGE) break;
-	  pollfds= realloc(pollfds,sizeof(*pollfds)*npollfds);
-	  if (!pollfds) failure_errno("realloc pollfds",errno);
-	  npollfdsavail= npollfds;
-	}
-	if (r) failure_errno("beforepoll",r);
-	r= poll(pollfds,npollfds,timeout);
-	if (r == -1) failure_errno("poll",errno);
-	adns_afterpoll(ads,pollfds, r?npollfds:0, 0);
-      }
+      r= adns_wait_poll(ads,&qu,&ans,&mcr);
     } else {
       r= adns_wait(ads,&qu,&ans,&mcr);
     }
Index: adns/dynamic/Makefile.in
diff -u adns/dynamic/Makefile.in:1.6 adns/dynamic/Makefile.in:1.8
--- adns/dynamic/Makefile.in:1.6	Wed May 12 22:33:17 1999
+++ adns/dynamic/Makefile.in	Wed Oct 13 02:16:30 1999
@@ -1,6 +1,11 @@
 # dynamic/Makefile - dynamic library Makefile
 # 
-#  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+#  This file is
+#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#
+#  It is part of adns, which is
+#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#    Copyright (C) 1999 Tony Finch <dot@dotat.at>
 #  
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -19,7 +24,7 @@
 srcdir=		@srcdir@
 VPATH=		@srcdir@
 
-TARGETS=	$(SHLIBFILE)
+TARGETS=	$(SHLIBFILE) $(SHLIBSONAME) $(SHLIBFORLINK)
 include		$(srcdir)/../settings.make
 include		$(srcdir)/../src/adns.make
 
@@ -30,6 +35,12 @@
 
 uninstall:
 		rm -f $(lib_dir)/$(SHLIBFILE)
+
+$(SHLIBFORLINK):
+		ln -s $(SHLIBSONAME) $(SHLIBFORLINK)
+
+$(SHLIBSONAME):
+		ln -s $(SHLIBFILE) $(SHLIBSONAME)
 
 $(SHLIBFILE):	$(ALLOBJS)
 		rm -f $@
Index: adns/regress/Makefile.in
diff -u adns/regress/Makefile.in:1.10 adns/regress/Makefile.in:1.11
--- adns/regress/Makefile.in:1.10	Sun Jul 11 20:11:05 1999
+++ adns/regress/Makefile.in	Sun Oct 10 14:16:24 1999
@@ -1,6 +1,11 @@
 # regress/Makefile - regression test Makefile
 # 
-#  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+#  This file is
+#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#
+#  It is part of adns, which is
+#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#    Copyright (C) 1999 Tony Finch <dot@dotat.at>
 #  
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
Index: adns/regress/case-abbrev.out
diff -u adns/regress/case-abbrev.out:1.1 adns/regress/case-abbrev.out:1.4
--- adns/regress/case-abbrev.out:1.1	Thu Jun 17 01:53:59 1999
+++ adns/regress/case-abbrev.out	Wed Oct 13 01:27:05 1999
@@ -16,25 +16,25 @@
 greenend.org.uk flags 0 type 131089 RP(822) submitted
 greenend.org.uk flags 0 type A(-) ownflags=a: nodata; nrrs=0; cname=$; owner=$; ttl=86400
 greenend.org.uk flags 0 type NS(raw) ownflags=a: ok; nrrs=2; cname=$; owner=$; ttl=86400
- "ns1.relativity.greenend.org.uk"
- "ns0.relativity.greenend.org.uk"
+ ns1.relativity.greenend.org.uk
+ ns0.relativity.greenend.org.uk
 greenend.org.uk flags 0 type CNAME(-) ownflags=a: nodata; nrrs=0; cname=$; owner=$; ttl=86400
 greenend.org.uk flags 0 type SOA(raw) ownflags=a: ok; nrrs=1; cname=$; owner=$; ttl=86400
- "ns.chiark.greenend.org.uk" "hostmaster.greenend.org.uk" 1999061300 28800 7200 604800 86400
+ ns.chiark.greenend.org.uk hostmaster.greenend.org.uk 1999061300 28800 7200 604800 86400
 greenend.org.uk flags 0 type PTR(raw) ownflags=a: nodata; nrrs=0; cname=$; owner=$; ttl=86400
 greenend.org.uk flags 0 type HINFO(-) ownflags=a: nodata; nrrs=0; cname=$; owner=$; ttl=86400
 greenend.org.uk flags 0 type MX(raw) ownflags=a: ok; nrrs=1; cname=$; owner=$; ttl=86400
- 10 "chiark.greenend.org.uk"
+ 10 chiark.greenend.org.uk
 greenend.org.uk flags 0 type TXT(-) ownflags=a: nodata; nrrs=0; cname=$; owner=$; ttl=86400
 greenend.org.uk flags 0 type RP(raw) ownflags=a: nodata; nrrs=0; cname=$; owner=$; ttl=86400
 greenend.org.uk flags 0 type A(addr) ownflags=a: nodata; nrrs=0; cname=$; owner=$; ttl=86400
 greenend.org.uk flags 0 type NS(+addr) ownflags=a: ok; nrrs=2; cname=$; owner=$; ttl=86400
- "ns0.relativity.greenend.org.uk": AF_INET 172.18.45.6
- "ns1.relativity.greenend.org.uk": AF_INET 172.18.45.65
+ ns0.relativity.greenend.org.uk ok 0 ok "OK" ( INET 172.18.45.6 )
+ ns1.relativity.greenend.org.uk ok 0 ok "OK" ( INET 172.18.45.65 )
 greenend.org.uk flags 0 type PTR(checked) ownflags=a: nodata; nrrs=0; cname=$; owner=$; ttl=86400
 greenend.org.uk flags 0 type MX(+addr) ownflags=a: ok; nrrs=1; cname=$; owner=$; ttl=86400
- 10 "chiark.greenend.org.uk": AF_INET 195.224.76.132
+ 10 chiark.greenend.org.uk ok 0 ok "OK" ( INET 195.224.76.132 )
 greenend.org.uk flags 0 type SOA(822) ownflags=a: ok; nrrs=1; cname=$; owner=$; ttl=86400
- "ns.chiark.greenend.org.uk" "hostmaster@greenend.org.uk" 1999061300 28800 7200 604800 86400
+ ns.chiark.greenend.org.uk hostmaster@greenend.org.uk 1999061300 28800 7200 604800 86400
 greenend.org.uk flags 0 type RP(822) ownflags=a: nodata; nrrs=0; cname=$; owner=$; ttl=86400
 rc=0
Index: adns/regress/case-brokenmail.out
diff -u /dev/null adns/regress/case-brokenmail.out:1.3
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/regress/case-brokenmail.out	Wed Oct 13 01:27:05 1999
@@ -0,0 +1,38 @@
+adns debug: using nameserver 172.18.45.6
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 0 type 15 MX(raw) submitted
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 0 type 65551 MX(+addr) submitted
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 256 type 15 MX(raw) submitted
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 256 type 65551 MX(+addr) submitted
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 260 type 15 MX(raw) submitted
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 260 type 65551 MX(+addr) submitted
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 0 type MX(raw): OK; nrrs=4; cname=$; owner=$; ttl=60
+ 10 manyaddrs.test.iwj.relativity.greenend.org.uk
+ 20 host.broken-delg.test.iwj.relativity.greenend.org.uk
+ 30 172.18.45.36
+ 40 cname-ptr.test.iwj.relativity.greenend.org.uk
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 256 type MX(raw): OK; nrrs=4; cname=$; owner=$; ttl=60
+ 10 manyaddrs.test.iwj.relativity.greenend.org.uk
+ 20 host.broken-delg.test.iwj.relativity.greenend.org.uk
+ 30 172.18.45.36
+ 40 cname-ptr.test.iwj.relativity.greenend.org.uk
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 260 type MX(raw): OK; nrrs=4; cname=$; owner=broken-mail.test.iwj.relativity.greenend.org.uk; ttl=60
+ 10 manyaddrs.test.iwj.relativity.greenend.org.uk
+ 20 host.broken-delg.test.iwj.relativity.greenend.org.uk
+ 30 172.18.45.36
+ 40 cname-ptr.test.iwj.relativity.greenend.org.uk
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 0 type MX(+addr): OK; nrrs=4; cname=$; owner=$; ttl=30
+ 10 manyaddrs.test.iwj.relativity.greenend.org.uk ok 0 ok "OK" ( INET 127.0.0.1 INET 172.18.45.6 INET 172.18.45.1 INET 172.18.45.35 )
+ 20 host.broken-delg.test.iwj.relativity.greenend.org.uk remotefail 30 timeout "DNS query timed out" ?
+ 30 172.18.45.36 permfail 300 nxdomain "No such domain" ( )
+ 40 cname-ptr.test.iwj.relativity.greenend.org.uk misconfig 101 prohibitedcname "DNS alias found where canonical name wanted" ( )
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 256 type MX(+addr): OK; nrrs=4; cname=$; owner=$; ttl=30
+ 10 manyaddrs.test.iwj.relativity.greenend.org.uk ok 0 ok "OK" ( INET 127.0.0.1 INET 172.18.45.6 INET 172.18.45.1 INET 172.18.45.35 )
+ 20 host.broken-delg.test.iwj.relativity.greenend.org.uk remotefail 30 timeout "DNS query timed out" ?
+ 30 172.18.45.36 permfail 300 nxdomain "No such domain" ( )
+ 40 cname-ptr.test.iwj.relativity.greenend.org.uk ok 0 ok "OK" ( INET 172.18.45.37 )
+broken-mail.test.iwj.relativity.greenend.org.uk. flags 260 type MX(+addr): OK; nrrs=4; cname=$; owner=broken-mail.test.iwj.relativity.greenend.org.uk; ttl=30
+ 10 manyaddrs.test.iwj.relativity.greenend.org.uk ok 0 ok "OK" ( INET 127.0.0.1 INET 172.18.45.6 INET 172.18.45.1 INET 172.18.45.35 )
+ 20 host.broken-delg.test.iwj.relativity.greenend.org.uk remotefail 30 timeout "DNS query timed out" ?
+ 30 172.18.45.36 permfail 300 nxdomain "No such domain" ( )
+ 40 cname-ptr.test.iwj.relativity.greenend.org.uk ok 0 ok "OK" ( INET 172.18.45.37 )
+rc=0
Index: adns/regress/case-brokenmail.sys
diff -u /dev/null adns/regress/case-brokenmail.sys:1.1
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/regress/case-brokenmail.sys	Sun Aug 15 15:24:15 1999
@@ -0,0 +1,516 @@
+default
+:15,65551 broken-mail.test.iwj.relativity.greenend.org.uk. 256/broken-mail.test.iwj.relativity.greenend.org.uk. 0x104/broken-mail.test.iwj.relativity.greenend.org.uk.
+ start 934726868.117908
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000425
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000059
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000043
+ sendto fd=4 addr=172.18.45.6:53
+     311f0100 00010000 00000000 0b62726f 6b656e2d 6d61696c 04746573 74036977
+     6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+     01.
+ sendto=65
+ +0.001836
+ sendto fd=4 addr=172.18.45.6:53
+     31200100 00010000 00000000 0b62726f 6b656e2d 6d61696c 04746573 74036977
+     6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+     01.
+ sendto=65
+ +0.002502
+ sendto fd=4 addr=172.18.45.6:53
+     31210100 00010000 00000000 0b62726f 6b656e2d 6d61696c 04746573 74036977
+     6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+     01.
+ sendto=65
+ +0.001986
+ sendto fd=4 addr=172.18.45.6:53
+     31220100 00010000 00000000 0b62726f 6b656e2d 6d61696c 04746573 74036977
+     6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+     01.
+ sendto=65
+ +0.002269
+ sendto fd=4 addr=172.18.45.6:53
+     31230100 00010000 00000000 0b62726f 6b656e2d 6d61696c 04746573 74036977
+     6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+     01.
+ sendto=65
+ +0.001950
+ sendto fd=4 addr=172.18.45.6:53
+     31240100 00010000 00000000 0b62726f 6b656e2d 6d61696c 04746573 74036977
+     6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+     01.
+ sendto=65
+ +0.001914
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.987543
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000654
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     311f8580 00010004 00010005 0b62726f 6b656e2d 6d61696c 04746573 74036977
+     6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+     01c00c00 0f000100 00003c00 38001404 686f7374 0b62726f 6b656e2d 64656c67
+     04746573 74036977 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 00c00c00 0f000100 00003c00 10001e03 31373202 31380234 35023336
+     00c00c00 0f000100 00003c00 0e002809 636e616d 652d7074 72c060c0 0c000f00
+     01000000 3c000e00 0a096d61 6e796164 647273c0 60c06000 02000100 00003c00
+     06036e73 30c069c0 c9000100 01000000 3c0004ac 122d23c0 c9000100 01000000
+     3c0004ac 122d06c0 c9000100 01000000 3c0004ac 122d01c0 c9000100 01000000
+     3c00047f 000001c0 e1000100 01000151 800004ac 122d06.
+ +0.001320
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31208580 00010004 00010005 0b62726f 6b656e2d 6d61696c 04746573 74036977
+     6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+     01c00c00 0f000100 00003c00 10001e03 31373202 31380234 35023336 00c00c00
+     0f000100 00003c00 31002809 636e616d 652d7074 72047465 73740369 776a0a72
+     656c6174 69766974 79086772 65656e65 6e64036f 72670275 6b00c00c 000f0001
+     0000003c 000e000a 096d616e 79616464 7273c075 c00c000f 00010000 003c0015
+     00140468 6f73740b 62726f6b 656e2d64 656c67c0 75c07500 02000100 00003c00
+     06036e73 30c07ec0 a8000100 01000000 3c0004ac 122d23c0 a8000100 01000000
+     3c0004ac 122d06c0 a8000100 01000000 3c0004ac 122d01c0 a8000100 01000000
+     3c00047f 000001c0 e1000100 01000151 800004ac 122d06.
+ +0.001688
+ sendto fd=4 addr=172.18.45.6:53
+     31250100 00010000 00000000 03313732 02313802 34350233 36000001 0001.
+ sendto=30
+ +0.000653
+ sendto fd=4 addr=172.18.45.6:53
+     31260100 00010000 00000000 09636e61 6d652d70 74720474 65737403 69776a0a
+     72656c61 74697669 74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ sendto=63
+ +0.000825
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.001147
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31218580 00010004 00010005 0b62726f 6b656e2d 6d61696c 04746573 74036977
+     6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+     01c00c00 0f000100 00003c00 31002809 636e616d 652d7074 72047465 73740369
+     776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275 6b00c00c
+     000f0001 0000003c 000e000a 096d616e 79616464 7273c059 c00c000f 00010000
+     003c0015 00140468 6f73740b 62726f6b 656e2d64 656c67c0 59c00c00 0f000100
+     00003c00 10001e03 31373202 31380234 35023336 00c05900 02000100 00003c00
+     06036e73 30c062c0 8c000100 01000000 3c0004ac 122d23c0 8c000100 01000000
+     3c0004ac 122d06c0 8c000100 01000000 3c0004ac 122d01c0 8c000100 01000000
+     3c00047f 000001c0 e1000100 01000151 800004ac 122d06.
+ +0.001330
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31228580 00010004 00010005 0b62726f 6b656e2d 6d61696c 04746573 74036977
+     6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+     01c00c00 0f000100 00003c00 31000a09 6d616e79 61646472 73047465 73740369
+     776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275 6b00c00c
+     000f0001 0000003c 00150014 04686f73 740b6272 6f6b656e 2d64656c 67c059c0
+     0c000f00 01000000 3c001000 1e033137 32023138 02343502 333600c0 0c000f00
+     01000000 3c000e00 2809636e 616d652d 707472c0 59c05900 02000100 00003c00
+     06036e73 30c062c0 4f000100 01000000 3c0004ac 122d23c0 4f000100 01000000
+     3c0004ac 122d06c0 4f000100 01000000 3c0004ac 122d01c0 4f000100 01000000
+     3c00047f 000001c0 e1000100 01000151 800004ac 122d06.
+ +0.001524
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.001003
+ sendto fd=4 addr=172.18.45.6:53
+     31290100 00010000 00000000 03313732 02313802 34350233 36000001 0001.
+ sendto=30
+ +0.000569
+ sendto fd=4 addr=172.18.45.6:53
+     312a0100 00010000 00000000 09636e61 6d652d70 74720474 65737403 69776a0a
+     72656c61 74697669 74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ sendto=63
+ +0.000842
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31238580 00010004 00010005 0b62726f 6b656e2d 6d61696c 04746573 74036977
+     6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+     01c00c00 0f000100 00003c00 38001404 686f7374 0b62726f 6b656e2d 64656c67
+     04746573 74036977 6a0a7265 6c617469 76697479 08677265 656e656e 64036f72
+     6702756b 00c00c00 0f000100 00003c00 10001e03 31373202 31380234 35023336
+     00c00c00 0f000100 00003c00 0e002809 636e616d 652d7074 72c060c0 0c000f00
+     01000000 3c000e00 0a096d61 6e796164 647273c0 60c06000 02000100 00003c00
+     06036e73 30c069c0 c9000100 01000000 3c0004ac 122d23c0 c9000100 01000000
+     3c0004ac 122d06c0 c9000100 01000000 3c0004ac 122d01c0 c9000100 01000000
+     3c00047f 000001c0 e1000100 01000151 800004ac 122d06.
+ +0.001306
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31248580 00010004 00010005 0b62726f 6b656e2d 6d61696c 04746573 74036977
+     6a0a7265 6c617469 76697479 08677265 656e656e 64036f72 6702756b 00000f00
+     01c00c00 0f000100 00003c00 10001e03 31373202 31380234 35023336 00c00c00
+     0f000100 00003c00 31002809 636e616d 652d7074 72047465 73740369 776a0a72
+     656c6174 69766974 79086772 65656e65 6e64036f 72670275 6b00c00c 000f0001
+     0000003c 000e000a 096d616e 79616464 7273c075 c00c000f 00010000 003c0015
+     00140468 6f73740b 62726f6b 656e2d64 656c67c0 75c07500 02000100 00003c00
+     06036e73 30c07ec0 a8000100 01000000 3c0004ac 122d23c0 a8000100 01000000
+     3c0004ac 122d06c0 a8000100 01000000 3c0004ac 122d01c0 a8000100 01000000
+     3c00047f 000001c0 e1000100 01000151 800004ac 122d06.
+ +0.001507
+ sendto fd=4 addr=172.18.45.6:53
+     312b0100 00010000 00000000 03313732 02313802 34350233 36000001 0001.
+ sendto=30
+ +0.000637
+ sendto fd=4 addr=172.18.45.6:53
+     312c0100 00010000 00000000 09636e61 6d652d70 74720474 65737403 69776a0a
+     72656c61 74697669 74790867 7265656e 656e6403 6f726702 756b0000 010001.
+ sendto=63
+ +0.000932
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000931
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31258583 00010000 00000000 03313732 02313802 34350233 36000001 0001.
+ +0.000242
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31268580 00010002 00010001 09636e61 6d652d70 74720474 65737403 69776a0a
+     72656c61 74697669 74790867 7265656e 656e6403 6f726702 756b0000 010001c0
+     0c000500 01000000 3c002903 70747204 74657374 0369776a 0a72656c 61746976
+     69747908 67726565 6e656e64 036f7267 02756b00 c04b0001 00010000 003c0004
+     ac122d25 c04f0002 00010000 003c0006 036e7330 c058c090 00010001 00015180
+     0004ac12 2d06.
+ +0.000737
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31298583 00010000 00000000 03313732 02313802 34350233 36000001 0001.
+ +0.000223
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312a8580 00010002 00010001 09636e61 6d652d70 74720474 65737403 69776a0a
+     72656c61 74697669 74790867 7265656e 656e6403 6f726702 756b0000 010001c0
+     0c000500 01000000 3c002903 70747204 74657374 0369776a 0a72656c 61746976
+     69747908 67726565 6e656e64 036f7267 02756b00 c04b0001 00010000 003c0004
+     ac122d25 c04f0002 00010000 003c0006 036e7330 c058c090 00010001 00015180
+     0004ac12 2d06.
+ +0.000756
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312b8583 00010000 00000000 03313732 02313802 34350233 36000001 0001.
+ +0.000291
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312c8580 00010002 00010001 09636e61 6d652d70 74720474 65737403 69776a0a
+     72656c61 74697669 74790867 7265656e 656e6403 6f726702 756b0000 010001c0
+     0c000500 01000000 3c002903 70747204 74657374 0369776a 0a72656c 61746976
+     69747908 67726565 6e656e64 036f7267 02756b00 c04b0001 00010000 003c0004
+     ac122d25 c04f0002 00010000 003c0006 036e7330 c058c090 00010001 00015180
+     0004ac12 2d06.
+ +0.000726
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000162
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.980649
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-04341
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000794
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000608
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000695
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.997903
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.007910
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000823
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000611
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000571
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.997995
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.007991
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000694
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000579
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000571
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998156
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.008157
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000655
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000749
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000606
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.997990
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.007995
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000836
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000612
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000631
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.997921
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.007925
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000699
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000725
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000606
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.997970
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.007965
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000739
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000582
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000570
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998109
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.008104
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000641
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000598
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000716
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998045
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.008043
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000646
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000576
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000594
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998184
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.008190
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000673
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000578
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000572
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998177
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.008168
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000659
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000577
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000571
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998193
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.008199
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000653
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000604
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000573
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998170
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.008181
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000699
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000589
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000758
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.997954
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.008126
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000684
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000582
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 04686f73 740b6272 6f6b656e 2d64656c 67047465
+     73740369 776a0a72 656c6174 69766974 79086772 65656e65 6e64036f 72670275
+     6b000001 0001.
+ sendto=70
+ +0.000578
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998156
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.007969
+ close fd=4
+ close=OK
+ +0.000812
Index: adns/regress/case-child.out
diff -u adns/regress/case-child.out:1.1 adns/regress/case-child.out:1.2
--- adns/regress/case-child.out:1.1	Thu Jun 17 00:16:25 1999
+++ adns/regress/case-child.out	Sat Aug 14 19:54:32 1999
@@ -1,5 +1,5 @@
 adns debug: using nameserver 172.18.45.6
 134.76.224.195.in-addr.arpa flags 0 type 65548 PTR(checked) submitted
 134.76.224.195.in-addr.arpa flags 0 type PTR(checked): OK; nrrs=1; cname=$; owner=$; ttl=78694
- "permutation-city.greenend.org.uk"
+ permutation-city.greenend.org.uk
 rc=0
Index: adns/regress/case-cnametocname.out
diff -u /dev/null adns/regress/case-cnametocname.out:1.1
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/regress/case-cnametocname.out	Sun Sep 26 19:22:44 1999
@@ -0,0 +1,5 @@
+adns debug: using nameserver 172.18.45.6
+intel.ugcs.caltech.edu. flags 0 type 1 A(-) submitted
+adns debug: allegedly canonical name ugintel.best.ugcs.caltech.edu is actually alias for drachma.ugcs.caltech.edu (QNAME=intel.ugcs.caltech.edu, QTYPE=A, NS=172.18.45.6)
+intel.ugcs.caltech.edu. flags 0 type A(-): DNS alias found where canonical name wanted; nrrs=0; cname=ugintel.best.ugcs.caltech.edu; owner=$; ttl=497758
+rc=0
Index: adns/regress/case-cnametocname.sys
diff -u /dev/null adns/regress/case-cnametocname.sys:1.1
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/regress/case-cnametocname.sys	Sun Sep 26 19:22:44 1999
@@ -0,0 +1,39 @@
+default
+:1 intel.ugcs.caltech.edu.
+ start 938369896.279735
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000179
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000054
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000041
+ sendto fd=4 addr=172.18.45.6:53
+     311f0100 00010000 00000000 05696e74 656c0475 67637307 63616c74 65636803
+     65647500 00010001.
+ sendto=40
+ +0.001628
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.998372
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.586476
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     311f8180 00010003 00050005 05696e74 656c0475 67637307 63616c74 65636803
+     65647500 00010001 05696e74 656c0475 67637307 63616c74 65636803 65647500
+     00050001 0007985e 000f0775 67696e74 656c0462 657374c0 2ec04a00 05000100
+     00000a00 0a076472 6163686d 61c02ec0 65000100 01000798 83000483 d72bacc0
+     2e000200 01000935 be000b08 70757263 68617365 c02ec02e 00020001 000935be
+     00070465 6e7679c0 2ec02e00 02000100 0935be00 09036f66 62036e65 7400c02e
+     00020001 000935be 00090674 7962616c 74c033c0 2e000200 01000935 be000e08
+     6d657263 7574696f 026e69c0 33c08b00 01000100 0935be00 0483d72b a7c0a200
+     01000100 0935be00 0483d72b 87c0b500 01000100 001ef800 04c6b4b6 07c0ca00
+     01000100 0100d700 0483d78b 64c0df00 01000100 0100d700 0483d7fe 63.
+ +0.001423
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000646
+ close fd=4
+ close=OK
+ +0.000242
Index: adns/regress/case-datapluscname.out
diff -u adns/regress/case-datapluscname.out:1.1 adns/regress/case-datapluscname.out:1.2
--- adns/regress/case-datapluscname.out:1.1	Thu Aug  5 01:03:20 1999
+++ adns/regress/case-datapluscname.out	Sat Aug 14 19:54:32 1999
@@ -22,7 +22,7 @@
 170.99.219.194.in-addr.arpa flags 292 type NS(raw): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
 170.99.219.194.in-addr.arpa flags 292 type SOA(raw): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
 170.99.219.194.in-addr.arpa flags 292 type PTR(raw): OK; nrrs=1; cname=$; owner=170.99.219.194.in-addr.arpa; ttl=171727
- "proxy.scoplife.gr"
+ proxy.scoplife.gr
 170.99.219.194.in-addr.arpa flags 292 type HINFO(-): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
 170.99.219.194.in-addr.arpa flags 292 type MX(raw): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
 170.99.219.194.in-addr.arpa flags 292 type TXT(-): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
@@ -33,7 +33,7 @@
 170.99.219.194.in-addr.arpa flags 292 type SOA(822): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
 170.99.219.194.in-addr.arpa flags 292 type RP(822): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
 170.99.219.194.in-addr.arpa flags 292 type PTR(checked): OK; nrrs=1; cname=$; owner=170.99.219.194.in-addr.arpa; ttl=171727
- "proxy.scoplife.gr"
+ proxy.scoplife.gr
 170.99.219.194.in-addr.arpa flags 292 type CNAME(-): OK; nrrs=1; cname=$; owner=170.99.219.194.in-addr.arpa; ttl=171726
- "170.168.99.219.194.in-addr.arpa"
+ 170.168.99.219.194.in-addr.arpa
 rc=0
Index: adns/regress/case-datapluscnamewait.out
diff -u adns/regress/case-datapluscnamewait.out:1.1 adns/regress/case-datapluscnamewait.out:1.2
--- adns/regress/case-datapluscnamewait.out:1.1	Thu Aug  5 01:03:21 1999
+++ adns/regress/case-datapluscnamewait.out	Sat Aug 14 19:54:32 1999
@@ -19,9 +19,9 @@
 adns debug: ignoring CNAME (to 170.168.99.219.194.in-addr.arpa) coexisting with RR (QNAME=170.99.219.194.in-addr.arpa, QTYPE=PTR(checked), NS=172.18.45.6)
 adns debug: ignoring RR with an unexpected owner 170.168.99.219.194.in-addr.arpa (QNAME=170.99.219.194.in-addr.arpa, QTYPE=PTR(checked), NS=172.18.45.6)
 170.99.219.194.in-addr.arpa flags 292 type PTR(raw): OK; nrrs=1; cname=$; owner=170.99.219.194.in-addr.arpa; ttl=171763
- "proxy.scoplife.gr"
+ proxy.scoplife.gr
 170.99.219.194.in-addr.arpa flags 292 type PTR(checked): OK; nrrs=1; cname=$; owner=170.99.219.194.in-addr.arpa; ttl=171763
- "proxy.scoplife.gr"
+ proxy.scoplife.gr
 170.99.219.194.in-addr.arpa flags 292 type A(-): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=600
 170.99.219.194.in-addr.arpa flags 292 type MX(raw): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
 170.99.219.194.in-addr.arpa flags 292 type RP(raw): No such data; nrrs=0; cname=170.168.99.219.194.in-addr.arpa; owner=170.99.219.194.in-addr.arpa; ttl=0
@@ -74,5 +74,5 @@
 adns debug: reply not found, id 311f, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
 adns debug: reply not found, id 312c, query owner 170.168.99.219.194.in-addr.arpa (NS=172.18.45.6)
 170.99.219.194.in-addr.arpa flags 292 type CNAME(-): OK; nrrs=1; cname=$; owner=170.99.219.194.in-addr.arpa; ttl=110056
- "170.168.99.219.194.in-addr.arpa"
+ 170.168.99.219.194.in-addr.arpa
 rc=0
Index: adns/regress/case-mailboxes.out
diff -u adns/regress/case-mailboxes.out:1.3 adns/regress/case-mailboxes.out:1.5
--- adns/regress/case-mailboxes.out:1.3	Sat Apr 17 17:23:11 1999
+++ adns/regress/case-mailboxes.out	Sun Aug 15 15:24:15 1999
@@ -1,10 +1,10 @@
 adns debug: using nameserver 172.18.45.6
 silly-rp.test.iwj.relativity.greenend.org.uk flags 0 type 131089 RP(822) submitted
 silly-rp.test.iwj.relativity.greenend.org.uk flags 0 type RP(822): OK; nrrs=6; cname=$; owner=$; ttl=60
- "<>" ""
- "i@ucam.org" ""
- "i.j@ucam.org" ""
- "\x22i\\.\\.j\x22@ucam.org" ""
- "\x22\\.i\x22@ucam.org" ""
- "\x22i\\.\x22@ucam.org" ""
+ . .
+ i@ucam.org .
+ i.j@ucam.org .
+ "i..j"@ucam.org .
+ ".i"@ucam.org .
+ "i."@ucam.org .
 rc=0
Index: adns/regress/case-manyptrwrong.out
diff -u adns/regress/case-manyptrwrong.out:1.1 adns/regress/case-manyptrwrong.out:1.2
--- adns/regress/case-manyptrwrong.out:1.1	Thu Jul 29 22:34:39 1999
+++ adns/regress/case-manyptrwrong.out	Sat Aug 14 19:54:32 1999
@@ -16,100 +16,100 @@
 254.0.99.203.in-addr.arpa flags 0 type 131089 RP(822) submitted
 adns debug: TCP connected (NS=195.224.55.129)
 254.0.99.203.in-addr.arpa flags 0 type PTR(raw): OK; nrrs=94; cname=$; owner=$; ttl=80790
- "ns.security.co.nz"
- "tetra.co.nz"
- "mail.agate.co.nz"
- "ns.agate.co.nz"
- "securitytraining.co.nz"
- "ns.giftbasket.co.nz"
- "ns.security.gen.nz"
- "bouquet.co.nz"
- "investigation.co.nz"
- "ns.nzipi.org.nz"
- "mail.neru.co.nz"
- "security.co.nz"
- "ns.storewatch.co.nz"
- "security.gen.nz"
- "ns.tetra.co.nz"
- "mail.tetra.co.nz"
- "ns.securicard.co.nz"
- "ns.underhour.co.nz"
- "bcc.co.nz"
- "security.org.nz"
- "burglaralarms.co.nz"
- "ns.safes.co.nz"
- "ns.security.org.nz"
- "couperconsulting.co.nz"
- "securityguards.co.nz"
- "ns.guards.co.nz"
- "asis.org.nz"
- "neru.co.nz"
- "giftbasket.co.nz"
- "magic.co.nz"
- "mail.bcc.co.nz"
- "ns.investigation.co.nz"
- "nzipi.org.nz"
- "ns.bouquet.co.nz"
- "mail.safes.co.nz"
- "ns.bcc.co.nz"
- "ns.burglaralarms.co.nz"
- "ns.securityguards.co.nz"
- "covertcameras.co.nz"
- "ns.neru.co.nz"
- "ns.covertcameras.co.nz"
- "bouquets.co.nz"
- "concentric.co.nz"
- "ns.securitytraining.co.nz"
- "mail.couperconsulting.co.nz"
- "retailsecurity.co.nz"
- "ns.concentric.co.nz"
- "mail.magic.co.nz"
- "nzangling.co.nz"
- "ns.couperconsulting.co.nz"
- "ns.nzangling.co.nz"
- "mail.storewatch.co.nz"
- "swift.co.nz"
- "mail.selective.co.nz"
- "ns.forefront.co.nz"
- "mail.nzangling.co.nz"
- "guards.co.nz"
- "mail.nzdesigns.co.nz"
- "storewatch.co.nz"
- "ns.securitymanagement.co.nz"
- "mail.woolworths.co.nz"
- "mail.concentric.co.nz"
- "selective.co.nz"
- "specialinvestigations.co.nz"
- "ns.swift.co.nz"
- "mail.swift.co.nz"
- "ns.securenet.net.nz"
- "privateinvestigation.co.nz"
- "ns.privateinvestigation.co.nz"
- "etrade.co.nz"
- "ns.specialinvestigations.co.nz"
- "mail.ansett.co.nz"
- "ftp.warrent.co.nz"
- "ns.retailsecurity.co.nz"
- "mail.securitymanagement.co.nz"
- "ns.magic.co.nz"
- "mail.forefront.co.nz"
- "mail.securicard.co.nz"
- "securicard.co.nz"
- "ns.nzdesigns.co.nz"
- "safes.co.nz"
- "ns.selective.co.nz"
- "forefront.co.nz"
- "securitymanagement.co.nz"
- "underhour.co.nz"
- "securenet.net.nz"
- "mail.specialinvestigations.co.nz"
- "nzdesigns.co.nz"
- "ns.etrade.co.nz"
- "mail.nzipi.org.nz"
- "mail.underhour.co.nz"
- "ns.asis.org.nz"
- "ns.bouquets.co.nz"
- "agate.co.nz"
+ ns.security.co.nz
+ tetra.co.nz
+ mail.agate.co.nz
+ ns.agate.co.nz
+ securitytraining.co.nz
+ ns.giftbasket.co.nz
+ ns.security.gen.nz
+ bouquet.co.nz
+ investigation.co.nz
+ ns.nzipi.org.nz
+ mail.neru.co.nz
+ security.co.nz
+ ns.storewatch.co.nz
+ security.gen.nz
+ ns.tetra.co.nz
+ mail.tetra.co.nz
+ ns.securicard.co.nz
+ ns.underhour.co.nz
+ bcc.co.nz
+ security.org.nz
+ burglaralarms.co.nz
+ ns.safes.co.nz
+ ns.security.org.nz
+ couperconsulting.co.nz
+ securityguards.co.nz
+ ns.guards.co.nz
+ asis.org.nz
+ neru.co.nz
+ giftbasket.co.nz
+ magic.co.nz
+ mail.bcc.co.nz
+ ns.investigation.co.nz
+ nzipi.org.nz
+ ns.bouquet.co.nz
+ mail.safes.co.nz
+ ns.bcc.co.nz
+ ns.burglaralarms.co.nz
+ ns.securityguards.co.nz
+ covertcameras.co.nz
+ ns.neru.co.nz
+ ns.covertcameras.co.nz
+ bouquets.co.nz
+ concentric.co.nz
+ ns.securitytraining.co.nz
+ mail.couperconsulting.co.nz
+ retailsecurity.co.nz
+ ns.concentric.co.nz
+ mail.magic.co.nz
+ nzangling.co.nz
+ ns.couperconsulting.co.nz
+ ns.nzangling.co.nz
+ mail.storewatch.co.nz
+ swift.co.nz
+ mail.selective.co.nz
+ ns.forefront.co.nz
+ mail.nzangling.co.nz
+ guards.co.nz
+ mail.nzdesigns.co.nz
+ storewatch.co.nz
+ ns.securitymanagement.co.nz
+ mail.woolworths.co.nz
+ mail.concentric.co.nz
+ selective.co.nz
+ specialinvestigations.co.nz
+ ns.swift.co.nz
+ mail.swift.co.nz
+ ns.securenet.net.nz
+ privateinvestigation.co.nz
+ ns.privateinvestigation.co.nz
+ etrade.co.nz
+ ns.specialinvestigations.co.nz
+ mail.ansett.co.nz
+ ftp.warrent.co.nz
+ ns.retailsecurity.co.nz
+ mail.securitymanagement.co.nz
+ ns.magic.co.nz
+ mail.forefront.co.nz
+ mail.securicard.co.nz
+ securicard.co.nz
+ ns.nzdesigns.co.nz
+ safes.co.nz
+ ns.selective.co.nz
+ forefront.co.nz
+ securitymanagement.co.nz
+ underhour.co.nz
+ securenet.net.nz
+ mail.specialinvestigations.co.nz
+ nzdesigns.co.nz
+ ns.etrade.co.nz
+ mail.nzipi.org.nz
+ mail.underhour.co.nz
+ ns.asis.org.nz
+ ns.bouquets.co.nz
+ agate.co.nz
 adns debug: reply not found, id 313b, query owner security.gen.nz (NS=195.224.55.129)
 adns debug: reply not found, id 313c, query owner ns.tetra.co.nz (NS=195.224.55.129)
 adns debug: reply not found, id 313d, query owner mail.tetra.co.nz (NS=195.224.55.129)
Index: adns/regress/case-manyptrwrongrem.out
diff -u adns/regress/case-manyptrwrongrem.out:1.1 adns/regress/case-manyptrwrongrem.out:1.2
--- adns/regress/case-manyptrwrongrem.out:1.1	Thu Jul 29 23:21:51 1999
+++ adns/regress/case-manyptrwrongrem.out	Sat Aug 14 19:54:32 1999
@@ -29,99 +29,99 @@
 254.0.99.203.in-addr.arpa flags 292 type RP(822): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
 adns debug: TCP connected (NS=140.200.128.13)
 254.0.99.203.in-addr.arpa flags 292 type PTR(raw): OK; nrrs=94; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86400
- "ns.security.co.nz"
- "tetra.co.nz"
- "mail.agate.co.nz"
- "ns.agate.co.nz"
- "securitytraining.co.nz"
- "ns.giftbasket.co.nz"
- "ns.security.gen.nz"
- "bouquet.co.nz"
- "investigation.co.nz"
- "ns.nzipi.org.nz"
- "mail.neru.co.nz"
- "security.co.nz"
- "ns.storewatch.co.nz"
- "security.gen.nz"
- "ns.tetra.co.nz"
- "mail.tetra.co.nz"
- "ns.securicard.co.nz"
- "ns.underhour.co.nz"
- "bcc.co.nz"
- "security.org.nz"
- "burglaralarms.co.nz"
- "ns.safes.co.nz"
- "ns.security.org.nz"
- "couperconsulting.co.nz"
- "securityguards.co.nz"
- "ns.guards.co.nz"
- "asis.org.nz"
- "neru.co.nz"
- "giftbasket.co.nz"
- "magic.co.nz"
- "mail.bcc.co.nz"
- "ns.investigation.co.nz"
- "nzipi.org.nz"
- "ns.bouquet.co.nz"
- "mail.safes.co.nz"
- "ns.bcc.co.nz"
- "ns.burglaralarms.co.nz"
- "ns.securityguards.co.nz"
- "covertcameras.co.nz"
- "ns.neru.co.nz"
- "ns.covertcameras.co.nz"
- "bouquets.co.nz"
- "concentric.co.nz"
- "ns.securitytraining.co.nz"
- "mail.couperconsulting.co.nz"
- "retailsecurity.co.nz"
- "ns.concentric.co.nz"
- "mail.magic.co.nz"
- "nzangling.co.nz"
- "ns.couperconsulting.co.nz"
- "ns.nzangling.co.nz"
- "mail.storewatch.co.nz"
- "swift.co.nz"
- "mail.selective.co.nz"
- "ns.forefront.co.nz"
- "mail.nzangling.co.nz"
- "guards.co.nz"
- "mail.nzdesigns.co.nz"
- "storewatch.co.nz"
- "ns.securitymanagement.co.nz"
- "mail.woolworths.co.nz"
- "mail.concentric.co.nz"
- "selective.co.nz"
- "specialinvestigations.co.nz"
- "ns.swift.co.nz"
- "mail.swift.co.nz"
- "ns.securenet.net.nz"
- "privateinvestigation.co.nz"
- "ns.privateinvestigation.co.nz"
- "etrade.co.nz"
- "ns.specialinvestigations.co.nz"
- "mail.ansett.co.nz"
- "ftp.warrent.co.nz"
- "ns.retailsecurity.co.nz"
- "mail.securitymanagement.co.nz"
- "ns.magic.co.nz"
- "mail.forefront.co.nz"
- "mail.securicard.co.nz"
- "securicard.co.nz"
- "ns.nzdesigns.co.nz"
- "safes.co.nz"
- "ns.selective.co.nz"
- "forefront.co.nz"
- "securitymanagement.co.nz"
- "underhour.co.nz"
- "securenet.net.nz"
- "mail.specialinvestigations.co.nz"
- "nzdesigns.co.nz"
- "ns.etrade.co.nz"
- "mail.nzipi.org.nz"
- "mail.underhour.co.nz"
- "ns.asis.org.nz"
- "ns.bouquets.co.nz"
- "agate.co.nz"
+ ns.security.co.nz
+ tetra.co.nz
+ mail.agate.co.nz
+ ns.agate.co.nz
+ securitytraining.co.nz
+ ns.giftbasket.co.nz
+ ns.security.gen.nz
+ bouquet.co.nz
+ investigation.co.nz
+ ns.nzipi.org.nz
+ mail.neru.co.nz
+ security.co.nz
+ ns.storewatch.co.nz
+ security.gen.nz
+ ns.tetra.co.nz
+ mail.tetra.co.nz
+ ns.securicard.co.nz
+ ns.underhour.co.nz
+ bcc.co.nz
+ security.org.nz
+ burglaralarms.co.nz
+ ns.safes.co.nz
+ ns.security.org.nz
+ couperconsulting.co.nz
+ securityguards.co.nz
+ ns.guards.co.nz
+ asis.org.nz
+ neru.co.nz
+ giftbasket.co.nz
+ magic.co.nz
+ mail.bcc.co.nz
+ ns.investigation.co.nz
+ nzipi.org.nz
+ ns.bouquet.co.nz
+ mail.safes.co.nz
+ ns.bcc.co.nz
+ ns.burglaralarms.co.nz
+ ns.securityguards.co.nz
+ covertcameras.co.nz
+ ns.neru.co.nz
+ ns.covertcameras.co.nz
+ bouquets.co.nz
+ concentric.co.nz
+ ns.securitytraining.co.nz
+ mail.couperconsulting.co.nz
+ retailsecurity.co.nz
+ ns.concentric.co.nz
+ mail.magic.co.nz
+ nzangling.co.nz
+ ns.couperconsulting.co.nz
+ ns.nzangling.co.nz
+ mail.storewatch.co.nz
+ swift.co.nz
+ mail.selective.co.nz
+ ns.forefront.co.nz
+ mail.nzangling.co.nz
+ guards.co.nz
+ mail.nzdesigns.co.nz
+ storewatch.co.nz
+ ns.securitymanagement.co.nz
+ mail.woolworths.co.nz
+ mail.concentric.co.nz
+ selective.co.nz
+ specialinvestigations.co.nz
+ ns.swift.co.nz
+ mail.swift.co.nz
+ ns.securenet.net.nz
+ privateinvestigation.co.nz
+ ns.privateinvestigation.co.nz
+ etrade.co.nz
+ ns.specialinvestigations.co.nz
+ mail.ansett.co.nz
+ ftp.warrent.co.nz
+ ns.retailsecurity.co.nz
+ mail.securitymanagement.co.nz
+ ns.magic.co.nz
+ mail.forefront.co.nz
+ mail.securicard.co.nz
+ securicard.co.nz
+ ns.nzdesigns.co.nz
+ safes.co.nz
+ ns.selective.co.nz
+ forefront.co.nz
+ securitymanagement.co.nz
+ underhour.co.nz
+ securenet.net.nz
+ mail.specialinvestigations.co.nz
+ nzdesigns.co.nz
+ ns.etrade.co.nz
+ mail.nzipi.org.nz
+ mail.underhour.co.nz
+ ns.asis.org.nz
+ ns.bouquets.co.nz
+ agate.co.nz
 254.0.99.203.in-addr.arpa flags 292 type PTR(checked): Inconsistent resource records in DNS; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86399
 rc=0
Index: adns/regress/case-manyptrwrongrst.out
diff -u adns/regress/case-manyptrwrongrst.out:1.3 adns/regress/case-manyptrwrongrst.out:1.4
--- adns/regress/case-manyptrwrongrst.out:1.3	Fri Jul 30 00:18:19 1999
+++ adns/regress/case-manyptrwrongrst.out	Sat Aug 14 19:54:32 1999
@@ -34,99 +34,99 @@
 adns debug: TCP connected (NS=172.18.45.6)
 adns debug: reply not found, id 312a, query owner 254.0.99.203.in-addr.arpa (NS=172.18.45.6)
 254.0.99.203.in-addr.arpa flags 292 type PTR(raw): OK; nrrs=94; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=20169
- "ns.security.co.nz"
- "tetra.co.nz"
- "mail.agate.co.nz"
- "ns.agate.co.nz"
- "securitytraining.co.nz"
- "ns.giftbasket.co.nz"
- "ns.security.gen.nz"
- "bouquet.co.nz"
- "investigation.co.nz"
- "ns.nzipi.org.nz"
- "mail.neru.co.nz"
- "security.co.nz"
- "ns.storewatch.co.nz"
- "security.gen.nz"
- "ns.tetra.co.nz"
- "mail.tetra.co.nz"
- "ns.securicard.co.nz"
- "ns.underhour.co.nz"
- "bcc.co.nz"
- "security.org.nz"
- "burglaralarms.co.nz"
- "ns.safes.co.nz"
- "ns.security.org.nz"
- "couperconsulting.co.nz"
- "securityguards.co.nz"
- "ns.guards.co.nz"
- "asis.org.nz"
- "neru.co.nz"
- "giftbasket.co.nz"
- "magic.co.nz"
- "mail.bcc.co.nz"
- "ns.investigation.co.nz"
- "nzipi.org.nz"
- "ns.bouquet.co.nz"
- "mail.safes.co.nz"
- "ns.bcc.co.nz"
- "ns.burglaralarms.co.nz"
- "ns.securityguards.co.nz"
- "covertcameras.co.nz"
- "ns.neru.co.nz"
- "ns.covertcameras.co.nz"
- "bouquets.co.nz"
- "concentric.co.nz"
- "ns.securitytraining.co.nz"
- "mail.couperconsulting.co.nz"
- "retailsecurity.co.nz"
- "ns.concentric.co.nz"
- "mail.magic.co.nz"
- "nzangling.co.nz"
- "ns.couperconsulting.co.nz"
- "ns.nzangling.co.nz"
- "mail.storewatch.co.nz"
- "swift.co.nz"
- "mail.selective.co.nz"
- "ns.forefront.co.nz"
- "mail.nzangling.co.nz"
- "guards.co.nz"
- "mail.nzdesigns.co.nz"
- "storewatch.co.nz"
- "ns.securitymanagement.co.nz"
- "mail.woolworths.co.nz"
- "mail.concentric.co.nz"
- "selective.co.nz"
- "specialinvestigations.co.nz"
- "ns.swift.co.nz"
- "mail.swift.co.nz"
- "ns.securenet.net.nz"
- "privateinvestigation.co.nz"
- "ns.privateinvestigation.co.nz"
- "etrade.co.nz"
- "ns.specialinvestigations.co.nz"
- "mail.ansett.co.nz"
- "ftp.warrent.co.nz"
- "ns.retailsecurity.co.nz"
- "mail.securitymanagement.co.nz"
- "ns.magic.co.nz"
- "mail.forefront.co.nz"
- "mail.securicard.co.nz"
- "securicard.co.nz"
- "ns.nzdesigns.co.nz"
- "safes.co.nz"
- "ns.selective.co.nz"
- "forefront.co.nz"
- "securitymanagement.co.nz"
- "underhour.co.nz"
- "securenet.net.nz"
- "mail.specialinvestigations.co.nz"
- "nzdesigns.co.nz"
- "ns.etrade.co.nz"
- "mail.nzipi.org.nz"
- "mail.underhour.co.nz"
- "ns.asis.org.nz"
- "ns.bouquets.co.nz"
- "agate.co.nz"
+ ns.security.co.nz
+ tetra.co.nz
+ mail.agate.co.nz
+ ns.agate.co.nz
+ securitytraining.co.nz
+ ns.giftbasket.co.nz
+ ns.security.gen.nz
+ bouquet.co.nz
+ investigation.co.nz
+ ns.nzipi.org.nz
+ mail.neru.co.nz
+ security.co.nz
+ ns.storewatch.co.nz
+ security.gen.nz
+ ns.tetra.co.nz
+ mail.tetra.co.nz
+ ns.securicard.co.nz
+ ns.underhour.co.nz
+ bcc.co.nz
+ security.org.nz
+ burglaralarms.co.nz
+ ns.safes.co.nz
+ ns.security.org.nz
+ couperconsulting.co.nz
+ securityguards.co.nz
+ ns.guards.co.nz
+ asis.org.nz
+ neru.co.nz
+ giftbasket.co.nz
+ magic.co.nz
+ mail.bcc.co.nz
+ ns.investigation.co.nz
+ nzipi.org.nz
+ ns.bouquet.co.nz
+ mail.safes.co.nz
+ ns.bcc.co.nz
+ ns.burglaralarms.co.nz
+ ns.securityguards.co.nz
+ covertcameras.co.nz
+ ns.neru.co.nz
+ ns.covertcameras.co.nz
+ bouquets.co.nz
+ concentric.co.nz
+ ns.securitytraining.co.nz
+ mail.couperconsulting.co.nz
+ retailsecurity.co.nz
+ ns.concentric.co.nz
+ mail.magic.co.nz
+ nzangling.co.nz
+ ns.couperconsulting.co.nz
+ ns.nzangling.co.nz
+ mail.storewatch.co.nz
+ swift.co.nz
+ mail.selective.co.nz
+ ns.forefront.co.nz
+ mail.nzangling.co.nz
+ guards.co.nz
+ mail.nzdesigns.co.nz
+ storewatch.co.nz
+ ns.securitymanagement.co.nz
+ mail.woolworths.co.nz
+ mail.concentric.co.nz
+ selective.co.nz
+ specialinvestigations.co.nz
+ ns.swift.co.nz
+ mail.swift.co.nz
+ ns.securenet.net.nz
+ privateinvestigation.co.nz
+ ns.privateinvestigation.co.nz
+ etrade.co.nz
+ ns.specialinvestigations.co.nz
+ mail.ansett.co.nz
+ ftp.warrent.co.nz
+ ns.retailsecurity.co.nz
+ mail.securitymanagement.co.nz
+ ns.magic.co.nz
+ mail.forefront.co.nz
+ mail.securicard.co.nz
+ securicard.co.nz
+ ns.nzdesigns.co.nz
+ safes.co.nz
+ ns.selective.co.nz
+ forefront.co.nz
+ securitymanagement.co.nz
+ underhour.co.nz
+ securenet.net.nz
+ mail.specialinvestigations.co.nz
+ nzdesigns.co.nz
+ ns.etrade.co.nz
+ mail.nzipi.org.nz
+ mail.underhour.co.nz
+ ns.asis.org.nz
+ ns.bouquets.co.nz
+ agate.co.nz
 254.0.99.203.in-addr.arpa flags 292 type PTR(checked): Inconsistent resource records in DNS; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=20167
 rc=0
Index: adns/regress/case-manyptrwrongrty.out
diff -u adns/regress/case-manyptrwrongrty.out:1.1 adns/regress/case-manyptrwrongrty.out:1.2
--- adns/regress/case-manyptrwrongrty.out:1.1	Thu Jul 29 23:21:54 1999
+++ adns/regress/case-manyptrwrongrty.out	Sat Aug 14 19:54:32 1999
@@ -23,100 +23,100 @@
 254.0.99.203.in-addr.arpa flags 292 type TXT(-): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=539
 254.0.99.203.in-addr.arpa flags 292 type RP(raw): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=539
 254.0.99.203.in-addr.arpa flags 292 type PTR(raw): OK; nrrs=94; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=86351
- "ns.security.co.nz"
- "tetra.co.nz"
- "mail.agate.co.nz"
- "ns.agate.co.nz"
- "securitytraining.co.nz"
- "ns.giftbasket.co.nz"
- "ns.security.gen.nz"
- "bouquet.co.nz"
- "investigation.co.nz"
- "ns.nzipi.org.nz"
- "mail.neru.co.nz"
- "security.co.nz"
- "ns.storewatch.co.nz"
- "security.gen.nz"
- "ns.tetra.co.nz"
- "mail.tetra.co.nz"
- "ns.securicard.co.nz"
- "ns.underhour.co.nz"
- "bcc.co.nz"
- "security.org.nz"
- "burglaralarms.co.nz"
- "ns.safes.co.nz"
- "ns.security.org.nz"
- "couperconsulting.co.nz"
- "securityguards.co.nz"
- "ns.guards.co.nz"
- "asis.org.nz"
- "neru.co.nz"
- "giftbasket.co.nz"
- "magic.co.nz"
- "mail.bcc.co.nz"
- "ns.investigation.co.nz"
- "nzipi.org.nz"
- "ns.bouquet.co.nz"
- "mail.safes.co.nz"
- "ns.bcc.co.nz"
- "ns.burglaralarms.co.nz"
- "ns.securityguards.co.nz"
- "covertcameras.co.nz"
- "ns.neru.co.nz"
- "ns.covertcameras.co.nz"
- "bouquets.co.nz"
- "concentric.co.nz"
- "ns.securitytraining.co.nz"
- "mail.couperconsulting.co.nz"
- "retailsecurity.co.nz"
- "ns.concentric.co.nz"
- "mail.magic.co.nz"
- "nzangling.co.nz"
- "ns.couperconsulting.co.nz"
- "ns.nzangling.co.nz"
- "mail.storewatch.co.nz"
- "swift.co.nz"
- "mail.selective.co.nz"
- "ns.forefront.co.nz"
- "mail.nzangling.co.nz"
- "guards.co.nz"
- "mail.nzdesigns.co.nz"
- "storewatch.co.nz"
- "ns.securitymanagement.co.nz"
- "mail.woolworths.co.nz"
- "mail.concentric.co.nz"
- "selective.co.nz"
- "specialinvestigations.co.nz"
- "ns.swift.co.nz"
- "mail.swift.co.nz"
- "ns.securenet.net.nz"
- "privateinvestigation.co.nz"
- "ns.privateinvestigation.co.nz"
- "etrade.co.nz"
- "ns.specialinvestigations.co.nz"
- "mail.ansett.co.nz"
- "ftp.warrent.co.nz"
- "ns.retailsecurity.co.nz"
- "mail.securitymanagement.co.nz"
- "ns.magic.co.nz"
- "mail.forefront.co.nz"
- "mail.securicard.co.nz"
- "securicard.co.nz"
- "ns.nzdesigns.co.nz"
- "safes.co.nz"
- "ns.selective.co.nz"
- "forefront.co.nz"
- "securitymanagement.co.nz"
- "underhour.co.nz"
- "securenet.net.nz"
- "mail.specialinvestigations.co.nz"
- "nzdesigns.co.nz"
- "ns.etrade.co.nz"
- "mail.nzipi.org.nz"
- "mail.underhour.co.nz"
- "ns.asis.org.nz"
- "ns.bouquets.co.nz"
- "agate.co.nz"
+ ns.security.co.nz
+ tetra.co.nz
+ mail.agate.co.nz
+ ns.agate.co.nz
+ securitytraining.co.nz
+ ns.giftbasket.co.nz
+ ns.security.gen.nz
+ bouquet.co.nz
+ investigation.co.nz
+ ns.nzipi.org.nz
+ mail.neru.co.nz
+ security.co.nz
+ ns.storewatch.co.nz
+ security.gen.nz
+ ns.tetra.co.nz
+ mail.tetra.co.nz
+ ns.securicard.co.nz
+ ns.underhour.co.nz
+ bcc.co.nz
+ security.org.nz
+ burglaralarms.co.nz
+ ns.safes.co.nz
+ ns.security.org.nz
+ couperconsulting.co.nz
+ securityguards.co.nz
+ ns.guards.co.nz
+ asis.org.nz
+ neru.co.nz
+ giftbasket.co.nz
+ magic.co.nz
+ mail.bcc.co.nz
+ ns.investigation.co.nz
+ nzipi.org.nz
+ ns.bouquet.co.nz
+ mail.safes.co.nz
+ ns.bcc.co.nz
+ ns.burglaralarms.co.nz
+ ns.securityguards.co.nz
+ covertcameras.co.nz
+ ns.neru.co.nz
+ ns.covertcameras.co.nz
+ bouquets.co.nz
+ concentric.co.nz
+ ns.securitytraining.co.nz
+ mail.couperconsulting.co.nz
+ retailsecurity.co.nz
+ ns.concentric.co.nz
+ mail.magic.co.nz
+ nzangling.co.nz
+ ns.couperconsulting.co.nz
+ ns.nzangling.co.nz
+ mail.storewatch.co.nz
+ swift.co.nz
+ mail.selective.co.nz
+ ns.forefront.co.nz
+ mail.nzangling.co.nz
+ guards.co.nz
+ mail.nzdesigns.co.nz
+ storewatch.co.nz
+ ns.securitymanagement.co.nz
+ mail.woolworths.co.nz
+ mail.concentric.co.nz
+ selective.co.nz
+ specialinvestigations.co.nz
+ ns.swift.co.nz
+ mail.swift.co.nz
+ ns.securenet.net.nz
+ privateinvestigation.co.nz
+ ns.privateinvestigation.co.nz
+ etrade.co.nz
+ ns.specialinvestigations.co.nz
+ mail.ansett.co.nz
+ ftp.warrent.co.nz
+ ns.retailsecurity.co.nz
+ mail.securitymanagement.co.nz
+ ns.magic.co.nz
+ mail.forefront.co.nz
+ mail.securicard.co.nz
+ securicard.co.nz
+ ns.nzdesigns.co.nz
+ safes.co.nz
+ ns.selective.co.nz
+ forefront.co.nz
+ securitymanagement.co.nz
+ underhour.co.nz
+ securenet.net.nz
+ mail.specialinvestigations.co.nz
+ nzdesigns.co.nz
+ ns.etrade.co.nz
+ mail.nzipi.org.nz
+ mail.underhour.co.nz
+ ns.asis.org.nz
+ ns.bouquets.co.nz
+ agate.co.nz
 254.0.99.203.in-addr.arpa flags 292 type A(addr): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=539
 254.0.99.203.in-addr.arpa flags 292 type NS(+addr): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=539
 254.0.99.203.in-addr.arpa flags 292 type MX(+addr): No such data; nrrs=0; cname=$; owner=254.0.99.203.in-addr.arpa; ttl=540
Index: adns/regress/case-norecurse.out
diff -u /dev/null adns/regress/case-norecurse.out:1.5
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/regress/case-norecurse.out	Tue Oct 12 22:35:06 1999
@@ -0,0 +1,62 @@
+adns debug: using nameserver 172.18.45.6
+4.204.50.158.in-addr.arpa flags 0 type 1 A(-) submitted
+4.204.50.158.in-addr.arpa flags 0 type 2 NS(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 5 CNAME(-) submitted
+4.204.50.158.in-addr.arpa flags 0 type 6 SOA(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 12 PTR(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 13adns debug: TCP connected (NS=172.18.45.6)
+ HINFO(-) submitted
+4.204.50.158.in-addr.arpa flags 0 type 15adns warning: TCP connection lost: poll/select: exceptional condition detected (NS=172.18.45.6)
+ MX(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 16 TXT(-) submitted
+4.204.50.158.in-addr.arpa flags 0 type 17 RP(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 65537 A(addr) submitted
+4.204.50.158.in-addr.arpa flags 0 type 65538 NS(+addr) submitted
+4.204.50.158.in-addr.arpa flags 0 type 65548 PTR(checked) submitted
+4.204.50.158.in-addr.arpa flags 0 type 65551adns debug: TCP connected (NS=172.18.45.6)
+ MX(+addr) submitted
+4.204.50.158.in-addr.arpa flags 0 type 131078adns warning: TCP connection lost: poll/select: exceptional condition detected (NS=172.18.45.6)
+ SOA(822) submitted
+4.204.50.158.in-addr.arpa flags 0 type 131089adns debug: reply not found, id 3141, query owner ns2.afpdoc.com (NS=172.18.45.6)
+adns debug: reply not found, id 3142, query owner ns2.afp-notes.com (NS=172.18.45.6)
+adns debug: reply not found, id 3143, query owner ns2.afp-domino.com (NS=172.18.45.6)
+ RP(822) submitted
+4.204.50.158.in-addr.arpa flags 0 type A(-): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type NS(raw): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type SOA(raw): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type HINFO(-): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type MX(raw): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type PTR(raw): OK; nrrs=23; cname=$; owner=$; ttl=77948
+ ns2.afp.com
+ ns.afp.com
+ news.afp.com
+ ns2.afp.fr
+ ns.afp.fr
+ news.afp.fr
+ ns2.agencefrancepresse.com
+ news.agencefrancepresse.com
+ ns2.agencefrancepresse.fr
+ news.agencefrancepresse.fr
+ ns2.agencefrance-presse.com
+ news.agencefrance-presse.com
+ ns2.agencefrance-presse.fr
+ news.agencefrance-presse.fr
+ ns2.imageforum.com
+ news.imageforum.com
+ ns2.imageforum.tm.fr
+ news.imageforum.tm.fr
+ ns2.ooh-lah-lah.com
+ ns2.afpsciences.com
+ ns2.afpdoc.com
+ ns2.afp-notes.com
+ ns2.afp-domino.com
+4.204.50.158.in-addr.arpa flags 0 type TXT(-): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type RP(raw): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type A(addr): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type NS(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type MX(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type SOA(822): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type PTR(checked): Inconsistent resource records in DNS; nrrs=0; cname=$; owner=$; ttl=77948
+4.204.50.158.in-addr.arpa flags 0 type RP(822): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type CNAME(-): No such data; nrrs=0; cname=$; owner=$; ttl=0
+rc=0
Index: adns/regress/case-norecurse.sys
diff -u /dev/null adns/regress/case-norecurse.sys:1.5
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/regress/case-norecurse.sys	Tue Oct 12 22:35:06 1999
@@ -0,0 +1,633 @@
+default -0x16
+4.204.50.158.in-addr.arpa
+ start 939764098.821612
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000163
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000053
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000041
+ sendto fd=4 addr=172.18.45.6:53
+     311f0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 010001.
+ sendto=43
+ +0.001437
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     311f8180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 010001.
+ +0.000286
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000152
+ sendto fd=4 addr=172.18.45.6:53
+     31200100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 020001.
+ sendto=43
+ +0.000904
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31208180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 020001.
+ +0.000247
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000144
+ sendto fd=4 addr=172.18.45.6:53
+     31210100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 050001.
+ sendto=43
+ +0.001157
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000093
+ sendto fd=4 addr=172.18.45.6:53
+     31220100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 060001.
+ sendto=43
+ +0.000957
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31228180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 060001.
+ +0.000249
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000113
+ sendto fd=4 addr=172.18.45.6:53
+     31230100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001.
+ sendto=43
+ +0.001196
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31238380 00010012 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001c0 0c000c00 01000130 7c000d03 6e733203 61667003
+     636f6d00 c00c000c 00010001 307c0005 026e73c0 3bc00c00 0c000100 01307c00
+     07046e65 7773c03b c00c000c 00010001 307c000c 036e7332 03616670 02667200
+     c00c000c 00010001 307c0005 026e73c0 78c00c00 0c000100 01307c00 07046e65
+     7773c078 c00c000c 00010001 307c0019 036e7332 12616765 6e636566 72616e63
+     65707265 737365c0 3fc00c00 0c000100 01307c00 07046e65 7773c0b4 c00c000c
+     00010001 307c0019 036e7332 12616765 6e636566 72616e63 65707265 737365c0
+     7cc00c00 0c000100 01307c00 07046e65 7773c0ec c00c000c 00010001 307c001a
+     036e7332 13616765 6e636566 72616e63 652d7072 65737365 c03fc00c 000c0001
+     0001307c 0007046e 657773c1 24c00c00 0c000100 01307c00 1a036e73 32136167
+     656e6365 6672616e 63652d70 72657373 65c07cc0 0c000c00 01000130 7c000704
+     6e657773 c15dc00c 000c0001 0001307c 0011036e 73320a69 6d616765 666f7275
+     6dc03fc0 0c000c00 01000130 7c000704 6e657773 c196c00c 000c0001 0001307c
+     0014036e 73320a69 6d616765 666f7275 6d02746d c07cc00c 000c0001 0001307c
+     0007046e 657773c1 c6.
+ +0.002263
+ socket type=SOCK_STREAM
+ socket=5
+ +0.000942
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000045
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000041
+ connect fd=5 addr=172.18.45.6:53
+ connect=EINPROGRESS
+ +0.000500
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000083
+ sendto fd=4 addr=172.18.45.6:53
+     31240100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0d0001.
+ sendto=43
+ +0.000925
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31248180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0d0001.
+ +0.000256
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000116
+ read fd=5 buflen=1
+ read=EAGAIN
+ +0.000123
+ write fd=5
+     002b3123 01000001 00000000 00000134 03323034 02353003 31353807 696e2d61
+     64647204 61727061 00000c00 01.
+ write=45
+ +0.001681
+ sendto fd=4 addr=172.18.45.6:53
+     31250100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0f0001.
+ sendto=43
+ +0.001010
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31258180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0f0001.
+ +0.000266
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000117
+ read fd=5 buflen=2
+ read=OK
+     02ac.
+ +0.000175
+ read fd=5 buflen=684
+ read=OK
+     31238180 00010017 00010001 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001c0 0c000c00 01000130 7c000d03 6e733203 61667003
+     636f6d00 c00c000c 00010001 307c0005 026e73c0 3bc00c00 0c000100 01307c00
+     07046e65 7773c03b c00c000c 00010001 307c000c 036e7332 03616670 02667200
+     c00c000c 00010001 307c0005 026e73c0 78c00c00 0c000100 01307c00 07046e65
+     7773c078 c00c000c 00010001 307c0019 036e7332 12616765 6e636566 72616e63
+     65707265 737365c0 3fc00c00 0c000100 01307c00 07046e65 7773c0b4 c00c000c
+     00010001 307c0019 036e7332 12616765 6e636566 72616e63 65707265 737365c0
+     7cc00c00 0c000100 01307c00 07046e65 7773c0ec c00c000c 00010001 307c001a
+     036e7332 13616765 6e636566 72616e63 652d7072 65737365 c03fc00c 000c0001
+     0001307c 0007046e 657773c1 24c00c00 0c000100 01307c00 1a036e73 32136167
+     656e6365 6672616e 63652d70 72657373 65c07cc0 0c000c00 01000130 7c000704
+     6e657773 c15dc00c 000c0001 0001307c 0011036e 73320a69 6d616765 666f7275
+     6dc03fc0 0c000c00 01000130 7c000704 6e657773 c196c00c 000c0001 0001307c
+     0014036e 73320a69 6d616765 666f7275 6d02746d c07cc00c 000c0001 0001307c
+     0007046e 657773c1 c6c00c00 0c000100 01307c00 12036e73 320b6f6f 682d6c61
+     682d6c61 68c03fc0 0c000c00 01000130 7c001203 6e73320b 61667073 6369656e
+     636573c0 3fc00c00 0c000100 01307c00 0d036e73 32066166 70646f63 c03fc00c
+     000c0001 0001307c 0010036e 73320961 66702d6e 6f746573 c03fc00c 000c0001
+     0001307c 0011036e 73320a61 66702d64 6f6d696e 6fc03f03 32303402 35300331
+     35380769 6e2d6164 64720461 72706100 00020001 0001307c 0002c037 c0370001
+     00010002 80980004 9e32cc04.
+ +0.002445
+ read fd=5 buflen=686
+ read=EAGAIN
+ +0.003282
+ close fd=5
+ close=OK
+ +0.000529
+ sendto fd=4 addr=172.18.45.6:53
+     31260100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 100001.
+ sendto=43
+ +0.000940
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31268180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 100001.
+ +0.000256
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000116
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 110001.
+ sendto=43
+ +0.000928
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31278180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 110001.
+ +0.000259
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000113
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 010001.
+ sendto=43
+ +0.000917
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31288180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 010001.
+ +0.000259
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000125
+ sendto fd=4 addr=172.18.45.6:53
+     31290100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 020001.
+ sendto=43
+ +0.000899
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31298180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 020001.
+ +0.000262
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000124
+ sendto fd=4 addr=172.18.45.6:53
+     312a0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001.
+ sendto=43
+ +0.001190
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312a8380 00010012 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001c0 0c000c00 01000130 7c000d03 6e733203 61667003
+     636f6d00 c00c000c 00010001 307c0005 026e73c0 3bc00c00 0c000100 01307c00
+     07046e65 7773c03b c00c000c 00010001 307c000c 036e7332 03616670 02667200
+     c00c000c 00010001 307c0005 026e73c0 78c00c00 0c000100 01307c00 07046e65
+     7773c078 c00c000c 00010001 307c0019 036e7332 12616765 6e636566 72616e63
+     65707265 737365c0 3fc00c00 0c000100 01307c00 07046e65 7773c0b4 c00c000c
+     00010001 307c0019 036e7332 12616765 6e636566 72616e63 65707265 737365c0
+     7cc00c00 0c000100 01307c00 07046e65 7773c0ec c00c000c 00010001 307c001a
+     036e7332 13616765 6e636566 72616e63 652d7072 65737365 c03fc00c 000c0001
+     0001307c 0007046e 657773c1 24c00c00 0c000100 01307c00 1a036e73 32136167
+     656e6365 6672616e 63652d70 72657373 65c07cc0 0c000c00 01000130 7c000704
+     6e657773 c15dc00c 000c0001 0001307c 0011036e 73320a69 6d616765 666f7275
+     6dc03fc0 0c000c00 01000130 7c000704 6e657773 c196c00c 000c0001 0001307c
+     0014036e 73320a69 6d616765 666f7275 6d02746d c07cc00c 000c0001 0001307c
+     0007046e 657773c1 c6.
+ +0.001723
+ socket type=SOCK_STREAM
+ socket=5
+ +0.000993
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000044
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000039
+ connect fd=5 addr=172.18.45.6:53
+ connect=EINPROGRESS
+ +0.000436
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000079
+ sendto fd=4 addr=172.18.45.6:53
+     312b0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0f0001.
+ sendto=43
+ +0.000907
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312b8180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0f0001.
+ +0.000264
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000118
+ read fd=5 buflen=1
+ read=EAGAIN
+ +0.000068
+ write fd=5
+     002b312a 01000001 00000000 00000134 03323034 02353003 31353807 696e2d61
+     64647204 61727061 00000c00 01.
+ write=45
+ +0.001361
+ sendto fd=4 addr=172.18.45.6:53
+     312c0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 060001.
+ sendto=43
+ +0.000875
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312c8180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 060001.
+ +0.000265
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000115
+ read fd=5 buflen=686
+ read=OK
+     02ac312a 81800001 00170001 00010134 03323034 02353003 31353807 696e2d61
+     64647204 61727061 00000c00 01c00c00 0c000100 01307c00 0d036e73 32036166
+     7003636f 6d00c00c 000c0001 0001307c 0005026e 73c03bc0 0c000c00 01000130
+     7c000704 6e657773 c03bc00c 000c0001 0001307c 000c036e 73320361 66700266
+     7200c00c 000c0001 0001307c 0005026e 73c078c0 0c000c00 01000130 7c000704
+     6e657773 c078c00c 000c0001 0001307c 0019036e 73321261 67656e63 65667261
+     6e636570 72657373 65c03fc0 0c000c00 01000130 7c000704 6e657773 c0b4c00c
+     000c0001 0001307c 0019036e 73321261 67656e63 65667261 6e636570 72657373
+     65c07cc0 0c000c00 01000130 7c000704 6e657773 c0ecc00c 000c0001 0001307c
+     001a036e 73321361 67656e63 65667261 6e63652d 70726573 7365c03f c00c000c
+     00010001 307c0007 046e6577 73c124c0 0c000c00 01000130 7c001a03 6e733213
+     6167656e 63656672 616e6365 2d707265 737365c0 7cc00c00 0c000100 01307c00
+     07046e65 7773c15d c00c000c 00010001 307c0011 036e7332 0a696d61 6765666f
+     72756dc0 3fc00c00 0c000100 01307c00 07046e65 7773c196 c00c000c 00010001
+     307c0014 036e7332 0a696d61 6765666f 72756d02 746dc07c c00c000c 00010001
+     307c0007 046e6577 73c1c6c0 0c000c00 01000130 7c001203 6e73320b 6f6f682d
+     6c61682d 6c6168c0 3fc00c00 0c000100 01307c00 12036e73 320b6166 70736369
+     656e6365 73c03fc0 0c000c00 01000130 7c000d03 6e733206 61667064 6f63c03f
+     c00c000c 00010001 307c0010 036e7332 09616670 2d6e6f74 6573c03f c00c000c
+     00010001 307c0011 036e7332 0a616670 2d646f6d 696e6fc0 3f033230 34023530
+     03313538 07696e2d 61646472 04617270 61000002 00010001 307c0002 c037c037
+     00010001 00028098 00049e32 cc04.
+ +0.002314
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 036e7332 03616670 03636f6d 00000100 01.
+ sendto=29
+ +0.001132
+ sendto fd=4 addr=172.18.45.6:53
+     312e0100 00010000 00000000 026e7303 61667003 636f6d00 00010001.
+ sendto=28
+ +0.000872
+ sendto fd=4 addr=172.18.45.6:53
+     312f0100 00010000 00000000 046e6577 73036166 7003636f 6d000001 0001.
+ sendto=30
+ +0.000864
+ sendto fd=4 addr=172.18.45.6:53
+     31300100 00010000 00000000 036e7332 03616670 02667200 00010001.
+ sendto=28
+ +0.000857
+ sendto fd=4 addr=172.18.45.6:53
+     31310100 00010000 00000000 026e7303 61667002 66720000 010001.
+ sendto=27
+ +0.001077
+ sendto fd=4 addr=172.18.45.6:53
+     31320100 00010000 00000000 046e6577 73036166 70026672 00000100 01.
+ sendto=29
+ +0.001081
+ sendto fd=4 addr=172.18.45.6:53
+     31330100 00010000 00000000 036e7332 12616765 6e636566 72616e63 65707265
+     73736503 636f6d00 00010001.
+ sendto=44
+ +0.001138
+ sendto fd=4 addr=172.18.45.6:53
+     31340100 00010000 00000000 046e6577 73126167 656e6365 6672616e 63657072
+     65737365 03636f6d 00000100 01.
+ sendto=45
+ +0.001216
+ sendto fd=4 addr=172.18.45.6:53
+     31350100 00010000 00000000 036e7332 12616765 6e636566 72616e63 65707265
+     73736502 66720000 010001.
+ sendto=43
+ +0.001134
+ sendto fd=4 addr=172.18.45.6:53
+     31360100 00010000 00000000 046e6577 73126167 656e6365 6672616e 63657072
+     65737365 02667200 00010001.
+ sendto=44
+ +0.001163
+ sendto fd=4 addr=172.18.45.6:53
+     31370100 00010000 00000000 036e7332 13616765 6e636566 72616e63 652d7072
+     65737365 03636f6d 00000100 01.
+ sendto=45
+ +0.001153
+ sendto fd=4 addr=172.18.45.6:53
+     31380100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+     72657373 6503636f 6d000001 0001.
+ sendto=46
+ +0.001167
+ sendto fd=4 addr=172.18.45.6:53
+     31390100 00010000 00000000 036e7332 13616765 6e636566 72616e63 652d7072
+     65737365 02667200 00010001.
+ sendto=44
+ +0.001170
+ sendto fd=4 addr=172.18.45.6:53
+     313a0100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+     72657373 65026672 00000100 01.
+ sendto=45
+ +0.001174
+ sendto fd=4 addr=172.18.45.6:53
+     313b0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d03 636f6d00
+     00010001.
+ sendto=36
+ +0.001119
+ sendto fd=4 addr=172.18.45.6:53
+     313c0100 00010000 00000000 046e6577 730a696d 61676566 6f72756d 03636f6d
+     00000100 01.
+ sendto=37
+ +0.001141
+ sendto fd=4 addr=172.18.45.6:53
+     313d0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d02 746d0266
+     72000001 0001.
+ sendto=38
+ +0.001115
+ sendto fd=4 addr=172.18.45.6:53
+     313e0100 00010000 00000000 046e6577 730a696d 61676566 6f72756d 02746d02
+     66720000 010001.
+ sendto=39
+ +0.001383
+ sendto fd=4 addr=172.18.45.6:53
+     313f0100 00010000 00000000 036e7332 0b6f6f68 2d6c6168 2d6c6168 03636f6d
+     00000100 01.
+ sendto=37
+ +0.001190
+ sendto fd=4 addr=172.18.45.6:53
+     31400100 00010000 00000000 036e7332 0b616670 73636965 6e636573 03636f6d
+     00000100 01.
+ sendto=37
+ +0.001178
+ sendto fd=4 addr=172.18.45.6:53
+     31410100 00010000 00000000 036e7332 06616670 646f6303 636f6d00 00010001.
+ sendto=32
+ +0.001112
+ sendto fd=4 addr=172.18.45.6:53
+     31420100 00010000 00000000 036e7332 09616670 2d6e6f74 65730363 6f6d0000
+     010001.
+ sendto=35
+ +0.001167
+ sendto fd=4 addr=172.18.45.6:53
+     31430100 00010000 00000000 036e7332 0a616670 2d646f6d 696e6f03 636f6d00
+     00010001.
+ sendto=36
+ +0.001187
+ read fd=5 buflen=686
+ read=EAGAIN
+ +0.000096
+ close fd=5
+ close=OK
+ +0.000598
+ sendto fd=4 addr=172.18.45.6:53
+     31440100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 110001.
+ sendto=43
+ +0.001333
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312d8180 00010001 00020002 036e7332 03616670 03636f6d 00000100 01c00c00
+     01000100 02809800 049e32cc 04034146 5003636f 6d000002 00010001 4d720002
+     c00cc02d 00020001 00014d72 0006036e 7331c02d c00c0001 00010002 80980004
+     9e32cc04 c04e0001 00010002 80980004 d0dfa603.
+ +0.000734
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312e8180 00010001 00020002 026e7303 61667003 636f6d00 00010001 c00c0001
+     00010001 4d720004 9e32cc04 03414650 03636f6d 00000200 0100014d 72000603
+     6e7332c0 2cc02c00 02000100 014d7200 06036e73 31c02cc0 3f000100 01000280
+     9800049e 32cc04c0 51000100 01000280 980004d0 dfa603.
+ +0.000768
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312f8180 00010001 00020002 046e6577 73036166 7003636f 6d000001 0001c00c
+     00010001 00013089 00049e32 cc040341 46500363 6f6d0000 02000100 014d7200
+     06036e73 32c02ec0 2e000200 0100014d 72000603 6e7331c0 2ec04100 01000100
+     02809800 049e32cc 04c05300 01000100 02809800 04d0dfa6 03.
+ +0.000623
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31308180 00010001 00020002 036e7332 03616670 02667200 00010001 c00c0001
+     00010001 30850004 9e32cc04 03616670 02667200 00020001 00013085 0002c00c
+     c02c0002 00010001 30850006 036e7331 c02cc00c 00010001 00013085 00049e32
+     cc04c04c 00010001 00013085 0004d0df a603.
+ +0.000602
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31318180 00010001 00020002 026e7303 61667002 66720000 010001c0 0c000100
+     01000130 8500049e 32cc0403 61667002 66720000 02000100 01308500 06036e73
+     32c02bc0 2b000200 01000130 85000603 6e7331c0 2bc03d00 01000100 01308500
+     049e32cc 04c04f00 01000100 01308500 04d0dfa6 03.
+ +0.000624
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31328180 00010001 00020002 046e6577 73036166 70026672 00000100 01c00c00
+     01000100 012f4700 049e32cc 04036166 70026672 00000200 01000130 85000603
+     6e7332c0 2dc02d00 02000100 01308500 06036e73 31c02dc0 3f000100 01000130
+     8500049e 32cc04c0 51000100 01000130 850004d0 dfa603.
+ +0.000643
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31338180 00010001 00020002 036e7332 12616765 6e636566 72616e63 65707265
+     73736503 636f6d00 00010001 c00c0001 00010001 30850004 9e32cc04 12616765
+     6e636566 72616e63 65707265 73736503 636f6d00 00020001 00013085 0002c00c
+     c03c0002 00010001 30850006 036e7331 c03cc00c 00010001 00013085 00049e32
+     cc04c06c 00010001 00013085 0004d0df a603.
+ +0.000703
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31348180 00010001 00020002 046e6577 73126167 656e6365 6672616e 63657072
+     65737365 03636f6d 00000100 01c00c00 01000100 01308500 049e32cc 04126167
+     656e6365 6672616e 63657072 65737365 03636f6d 00000200 01000130 85000603
+     6e7332c0 3dc03d00 02000100 01308500 06036e73 31c03dc0 5f000100 01000130
+     8500049e 32cc04c0 71000100 01000130 850004d0 dfa603.
+ +0.000750
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31358180 00010001 00020002 036e7332 12616765 6e636566 72616e63 65707265
+     73736502 66720000 010001c0 0c000100 01000130 8900049e 32cc0412 6167656e
+     63656672 616e6365 70726573 73650266 72000002 00010001 30890002 c00cc03b
+     00020001 00013089 0006036e 7331c03b c00c0001 00010001 30890004 9e32cc04
+     c06a0001 00010001 30890004 d0dfa603.
+ +0.000708
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31368180 00010001 00020002 046e6577 73126167 656e6365 6672616e 63657072
+     65737365 02667200 00010001 c00c0001 00010001 30890004 9e32cc04 12616765
+     6e636566 72616e63 65707265 73736502 66720000 02000100 01308900 06036e73
+     32c03cc0 3c000200 01000130 89000603 6e7331c0 3cc05d00 01000100 01308900
+     049e32cc 04c06f00 01000100 01308900 04d0dfa6 03.
+ +0.000739
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31378180 00010001 00020002 036e7332 13616765 6e636566 72616e63 652d7072
+     65737365 03636f6d 00000100 01c00c00 01000100 014dd900 049e32cc 04136167
+     656e6365 6672616e 63652d70 72657373 6503636f 6d000002 00010001 4dd90002
+     c00cc03d 00020001 00014dd9 0006036e 7331c03d c00c0001 00010001 4dd90004
+     9e32cc04 c06e0001 00010001 4dd90004 d0dfa603.
+ +0.000723
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31388180 00010001 00020002 046e6577 73136167 656e6365 6672616e 63652d70
+     72657373 6503636f 6d000001 0001c00c 00010001 00014dd9 00049e32 cc041361
+     67656e63 65667261 6e63652d 70726573 73650363 6f6d0000 02000100 014dd900
+     06036e73 32c03ec0 3e000200 0100014d d9000603 6e7331c0 3ec06100 01000100
+     014dd900 049e32cc 04c07300 01000100 014dd900 04d0dfa6 03.
+ +0.000757
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31398180 00010001 00020002 036e7332 13616765 6e636566 72616e63 652d7072
+     65737365 02667200 00010001 c00c0001 00010001 30890004 9e32cc04 13616765
+     6e636566 72616e63 652d7072 65737365 02667200 00020001 00013089 0002c00c
+     c03c0002 00010001 30890006 036e7331 c03cc00c 00010001 00013089 00049e32
+     cc04c06c 00010001 00013089 0004d0df a603.
+ +0.000721
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     313a8180 00010001 00020002 046e6577 73136167 656e6365 6672616e 63652d70
+     72657373 65026672 00000100 01c00c00 01000100 01308900 049e32cc 04136167
+     656e6365 6672616e 63652d70 72657373 65026672 00000200 01000130 89000603
+     6e7332c0 3dc03d00 02000100 01308900 06036e73 31c03dc0 5f000100 01000130
+     8900049e 32cc04c0 71000100 01000130 890004d0 dfa603.
+ +0.000732
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     313b8180 00010001 00020002 036e7332 0a696d61 6765666f 72756d03 636f6d00
+     00010001 c00c0001 00010001 30890004 9e32cc04 0a696d61 6765666f 72756d03
+     636f6d00 00020001 00013089 0002c00c c0340002 00010001 30890006 036e7331
+     c034c00c 00010001 00013089 00049e32 cc04c05c 00010001 00013089 0004d0df
+     a603.
+ +0.000677
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     313c8180 00010001 00020002 046e6577 730a696d 61676566 6f72756d 03636f6d
+     00000100 01c00c00 01000100 01308900 049e32cc 040a696d 61676566 6f72756d
+     03636f6d 00000200 01000130 89000603 6e7332c0 35c03500 02000100 01308900
+     06036e73 31c035c0 4f000100 01000130 8900049e 32cc04c0 61000100 01000130
+     890004d0 dfa603.
+ +0.000673
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     313d8180 00010001 00020002 036e7332 0a696d61 6765666f 72756d02 746d0266
+     72000001 0001c00c 00010001 000280c4 00049e32 cc040a69 6d616765 666f7275
+     6d02746d 02667200 00020001 000280c4 0002c00c c0360002 00010002 80c40006
+     036e7331 c036c00c 00010001 000280c4 00049e32 cc04c060 00010001 000280c4
+     0004d0df a603.
+ +0.000687
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     313e8180 00010001 00020002 046e6577 730a696d 61676566 6f72756d 02746d02
+     66720000 010001c0 0c000100 0100012f 4500049e 32cc040a 696d6167 65666f72
+     756d0274 6d026672 00000200 01000280 c4000603 6e7332c0 37c03700 02000100
+     0280c400 06036e73 31c037c0 53000100 01000280 c400049e 32cc04c0 65000100
+     01000280 c40004d0 dfa603.
+ +0.000685
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     313f8180 00010001 00020002 036e7332 0b6f6f68 2d6c6168 2d6c6168 03636f6d
+     00000100 01c00c00 01000100 014dd900 049e32cc 040b6f6f 682d6c61 682d6c61
+     6803636f 6d000002 00010001 4dd90002 c00cc035 00020001 00014dd9 0006036e
+     7331c035 c00c0001 00010001 4dd90004 9e32cc04 c05e0001 00010001 4dd90004
+     d0dfa603.
+ +0.000664
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31408180 00010000 00010000 036e7332 0b616670 73636965 6e636573 03636f6d
+     00000100 010b6166 70736369 656e6365 7303636f 6d000006 00010000 0148002c
+     03646e73 08766963 746f6972 65026672 0004726f 6f74c044 77276589 00007080
+     00001c20 004f1a00 00015180.
+ +0.000607
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31418180 00010000 00010000 036e7332 06616670 646f6303 636f6d00 00010001
+     06616670 646f6303 636f6d00 00060001 00000148 002c0364 6e730876 6963746f
+     69726502 66720004 726f6f74 c03a7727 65890000 70800000 1c20004f 1a000001
+     5180.
+ +0.001536
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31428180 00010001 00020002 036e7332 09616670 2d6e6f74 65730363 6f6d0000
+     010001c0 0c000100 01000130 8900049e 32cc0409 6166702d 6e6f7465 7303636f
+     6d000002 00010001 30890002 c00cc033 00020001 00013089 0006036e 7331c033
+     c00c0001 00010001 30890004 9e32cc04 c05a0001 00010001 30890004 d0dfa603.
+ +0.000601
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31438180 00010001 00020002 036e7332 0a616670 2d646f6d 696e6f03 636f6d00
+     00010001 c00c0001 00010001 30890004 9e32cc04 0a616670 2d646f6d 696e6f03
+     636f6d00 00020001 00013089 0002c00c c0340002 00010001 30890006 036e7331
+     c034c00c 00010001 00013089 00049e32 cc04c05c 00010001 00013089 0004d0df
+     a603.
+ +0.000629
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31448180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 110001.
+ +0.000317
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000116
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.920611
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-754319
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31218580 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 050001.
+ +0.000252
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000127
+ close fd=4
+ close=OK
+ +0.000208
Index: adns/regress/case-norecurse2.out
diff -u /dev/null adns/regress/case-norecurse2.out:1.4
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/regress/case-norecurse2.out	Tue Oct 12 22:38:23 1999
@@ -0,0 +1,60 @@
+adns debug: using nameserver 172.18.45.6
+4.204.50.158.in-addr.arpa flags 0 type 1 A(-) submitted
+4.204.50.158.in-addr.arpa flags 0 type 2 NS(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 5 CNAME(-) submitted
+4.204.50.158.in-addr.arpa flags 0 type 6 SOA(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 12 PTR(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 13 HINFO(-) submitted
+4.204.50.158.in-addr.arpa flags 0 type 15 MX(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 16 TXT(-) submitted
+4.204.50.158.in-addr.arpa flags 0 type 17 RP(raw) submitted
+4.204.50.158.in-addr.arpa flags 0 type 65537 A(addr) submitted
+4.204.50.158.in-addr.arpa flags 0 type 65538 NS(+addr) submitted
+4.204.50.158.in-addr.arpa flags 0 type 65548 PTR(checked) submitted
+4.204.50.158.in-addr.arpa flags 0 type 65551 MX(+addr) submitted
+4.204.50.158.in-addr.arpa flags 0 type 131078 SOA(822) submitted
+4.204.50.158.in-addr.arpa flags 0 type 131089 RP(822) submitted
+4.204.50.158.in-addr.arpa flags 0 type SOA(raw): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type HINFO(-): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type MX(raw): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type TXT(-): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type MX(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type A(addr): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type NS(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type RP(822): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type A(-): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type NS(raw): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type SOA(822): No such data; nrrs=0; cname=$; owner=$; ttl=0
+adns debug: reply not found, id 312c, query owner 4.204.50.158.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 311f, query owner 4.204.50.158.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 3120, query owner 4.204.50.158.in-addr.arpa (NS=172.18.45.6)
+adns debug: reply not found, id 312a, query owner 4.204.50.158.in-addr.arpa (NS=172.18.45.6)
+4.204.50.158.in-addr.arpa flags 0 type RP(raw): No such data; nrrs=0; cname=$; owner=$; ttl=0
+4.204.50.158.in-addr.arpa flags 0 type CNAME(-): No such data; nrrs=0; cname=$; owner=$; ttl=0
+adns debug: TCP connected (NS=172.18.45.6)
+4.204.50.158.in-addr.arpa flags 0 type PTR(raw): OK; nrrs=23; cname=$; owner=$; ttl=0
+ ns2.afp.com
+ ns.afp.com
+ news.afp.com
+ ns2.afp.fr
+ ns.afp.fr
+ news.afp.fr
+ ns2.agencefrancepresse.com
+ news.agencefrancepresse.com
+ ns2.agencefrancepresse.fr
+ news.agencefrancepresse.fr
+ ns2.agencefrance-presse.com
+ news.agencefrance-presse.com
+ ns2.agencefrance-presse.fr
+ news.agencefrance-presse.fr
+ ns2.imageforum.com
+ news.imageforum.com
+ ns2.imageforum.tm.fr
+ news.imageforum.tm.fr
+ ns2.ooh-lah-lah.com
+ ns2.afpsciences.com
+ ns2.afpdoc.com
+ ns2.afp-notes.com
+ ns2.afp-domino.com
+4.204.50.158.in-addr.arpa flags 0 type PTR(checked): Inconsistent resource records in DNS; nrrs=0; cname=$; owner=$; ttl=-6
+rc=0
Index: adns/regress/case-norecurse2.sys
diff -u /dev/null adns/regress/case-norecurse2.sys:1.4
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/regress/case-norecurse2.sys	Tue Oct 12 22:38:23 1999
@@ -0,0 +1,1212 @@
+default -0x16
+4.204.50.158.in-addr.arpa
+ start 939764277.018636
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000162
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000052
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000042
+ sendto fd=4 addr=172.18.45.6:53
+     311f0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 010001.
+ sendto=43
+ +0.001984
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000131
+ sendto fd=4 addr=172.18.45.6:53
+     31200100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 020001.
+ sendto=43
+ +0.001195
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000092
+ sendto fd=4 addr=172.18.45.6:53
+     31210100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 050001.
+ sendto=43
+ +0.001175
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000096
+ sendto fd=4 addr=172.18.45.6:53
+     31220100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 060001.
+ sendto=43
+ +0.001216
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000098
+ sendto fd=4 addr=172.18.45.6:53
+     31230100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001.
+ sendto=43
+ +0.001153
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000095
+ sendto fd=4 addr=172.18.45.6:53
+     31240100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0d0001.
+ sendto=43
+ +0.001170
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000103
+ sendto fd=4 addr=172.18.45.6:53
+     31250100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0f0001.
+ sendto=43
+ +0.001162
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000099
+ sendto fd=4 addr=172.18.45.6:53
+     31260100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 100001.
+ sendto=43
+ +0.001193
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000104
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 110001.
+ sendto=43
+ +0.001203
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000105
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 010001.
+ sendto=43
+ +0.001379
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000105
+ sendto fd=4 addr=172.18.45.6:53
+     31290100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 020001.
+ sendto=43
+ +0.001199
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000107
+ sendto fd=4 addr=172.18.45.6:53
+     312a0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001.
+ sendto=43
+ +0.001196
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000111
+ sendto fd=4 addr=172.18.45.6:53
+     312b0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0f0001.
+ sendto=43
+ +0.001229
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000114
+ sendto fd=4 addr=172.18.45.6:53
+     312c0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 060001.
+ sendto=43
+ +0.001187
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000115
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 110001.
+ sendto=43
+ +0.001165
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000116
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.979603
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.005569
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31228580 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 060001.
+ +0.000287
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000173
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.973574
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.149373
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31248580 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0d0001.
+ +0.000294
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000119
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.823788
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.019622
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31258580 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0f0001.
+ +0.000268
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000116
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.803782
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.019566
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31268580 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 100001.
+ +0.000266
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000116
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.783834
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.019476
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312b8180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0f0001.
+ +0.000261
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000120
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.763977
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.189710
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31288580 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 010001.
+ +0.000268
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000119
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.573880
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.019648
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31298580 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 020001.
+ +0.000260
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000119
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.553853
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.019563
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312d8180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 110001.
+ +0.000257
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000119
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.533914
+ select=0 rfds=[] wfds=[] efds=[]
+ +1.-463554
+ sendto fd=4 addr=172.18.45.6:53
+     311f0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 010001.
+ sendto=43
+ +0.000546
+ sendto fd=4 addr=172.18.45.6:53
+     31200100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 020001.
+ sendto=43
+ +0.000484
+ sendto fd=4 addr=172.18.45.6:53
+     31210100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 050001.
+ sendto=43
+ +0.000485
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.002425
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000119
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     311f8180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 010001.
+ +0.000255
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31208180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 020001.
+ +0.000284
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000100
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.001182
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.007693
+ sendto fd=4 addr=172.18.45.6:53
+     31230100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001.
+ sendto=43
+ +0.000479
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 110001.
+ sendto=43
+ +0.000465
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.001722
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009054
+ sendto fd=4 addr=172.18.45.6:53
+     312a0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001.
+ sendto=43
+ +0.000480
+ sendto fd=4 addr=172.18.45.6:53
+     312c0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 060001.
+ sendto=43
+ +0.000488
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.980098
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000131
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312c8180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 060001.
+ +0.000231
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000119
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.979617
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-21402
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.001019
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009951
+ sendto fd=4 addr=172.18.45.6:53
+     31210100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 050001.
+ sendto=43
+ +0.000505
+ sendto fd=4 addr=172.18.45.6:53
+     31230100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001.
+ sendto=43
+ +0.000530
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 110001.
+ sendto=43
+ +0.000468
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009497
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008500
+ sendto fd=4 addr=172.18.45.6:53
+     312a0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001.
+ sendto=43
+ +0.000459
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.989538
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-10446
+ sendto fd=4 addr=172.18.45.6:53
+     31210100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 050001.
+ sendto=43
+ +0.000537
+ sendto fd=4 addr=172.18.45.6:53
+     31230100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001.
+ sendto=43
+ +0.000485
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 110001.
+ sendto=43
+ +0.000487
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009450
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008478
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000000
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.000106
+ sendto fd=4 addr=172.18.45.6:53
+     312a0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001.
+ sendto=43
+ +0.000456
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.989451
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-10542
+ sendto fd=4 addr=172.18.45.6:53
+     31210100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 050001.
+ sendto=43
+ +0.000612
+ sendto fd=4 addr=172.18.45.6:53
+     31230100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001.
+ sendto=43
+ +0.000552
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 110001.
+ sendto=43
+ +0.000564
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.009474
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008252
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000106
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009994
+ sendto fd=4 addr=172.18.45.6:53
+     312a0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001.
+ sendto=43
+ +0.000467
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.979559
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.372703
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312c8180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 060001.
+ +0.000261
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000225
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.606370
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039270
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     311f8180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 010001.
+ +0.000255
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000224
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.566621
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.149484
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31208180 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 020001.
+ +0.000261
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000200
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.416676
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-583334
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000010
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.010045
+ sendto fd=4 addr=172.18.45.6:53
+     31210100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 050001.
+ sendto=43
+ +0.000504
+ sendto fd=4 addr=172.18.45.6:53
+     31230100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001.
+ sendto=43
+ +0.000456
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 110001.
+ sendto=43
+ +0.000499
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.008480
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008495
+ sendto fd=4 addr=172.18.45.6:53
+     312a0100 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001.
+ sendto=43
+ +0.000644
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.989402
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.490712
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31278580 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 110001.
+ +0.001892
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31238380 00010012 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001c0 0c000c00 01000000 00000d03 6e733203 61667003
+     636f6d00 c00c000c 00010000 00000005 026e73c0 3bc00c00 0c000100 00000000
+     07046e65 7773c03b c00c000c 00010000 0000000c 036e7332 03616670 02667200
+     c00c000c 00010000 00000005 026e73c0 78c00c00 0c000100 00000000 07046e65
+     7773c078 c00c000c 00010000 00000019 036e7332 12616765 6e636566 72616e63
+     65707265 737365c0 3fc00c00 0c000100 00000000 07046e65 7773c0b4 c00c000c
+     00010000 00000019 036e7332 12616765 6e636566 72616e63 65707265 737365c0
+     7cc00c00 0c000100 00000000 07046e65 7773c0ec c00c000c 00010000 0000001a
+     036e7332 13616765 6e636566 72616e63 652d7072 65737365 c03fc00c 000c0001
+     00000000 0007046e 657773c1 24c00c00 0c000100 00000000 1a036e73 32136167
+     656e6365 6672616e 63652d70 72657373 65c07cc0 0c000c00 01000000 00000704
+     6e657773 c15dc00c 000c0001 00000000 0011036e 73320a69 6d616765 666f7275
+     6dc03fc0 0c000c00 01000000 00000704 6e657773 c196c00c 000c0001 00000000
+     0014036e 73320a69 6d616765 666f7275 6d02746d c07cc00c 000c0001 00000000
+     0007046e 657773c1 c6.
+ +0.003281
+ socket type=SOCK_STREAM
+ socket=5
+ +0.002885
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000045
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000039
+ connect fd=5 addr=172.18.45.6:53
+ connect=EINPROGRESS
+ +0.000565
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31218580 00010000 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 050001.
+ +0.000249
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312a8380 00010012 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001c0 0c000c00 01000000 00000d03 6e733203 61667003
+     636f6d00 c00c000c 00010000 00000005 026e73c0 3bc00c00 0c000100 00000000
+     07046e65 7773c03b c00c000c 00010000 0000000c 036e7332 03616670 02667200
+     c00c000c 00010000 00000005 026e73c0 78c00c00 0c000100 00000000 07046e65
+     7773c078 c00c000c 00010000 00000019 036e7332 12616765 6e636566 72616e63
+     65707265 737365c0 3fc00c00 0c000100 00000000 07046e65 7773c0b4 c00c000c
+     00010000 00000019 036e7332 12616765 6e636566 72616e63 65707265 737365c0
+     7cc00c00 0c000100 00000000 07046e65 7773c0ec c00c000c 00010000 0000001a
+     036e7332 13616765 6e636566 72616e63 652d7072 65737365 c03fc00c 000c0001
+     00000000 0007046e 657773c1 24c00c00 0c000100 00000000 1a036e73 32136167
+     656e6365 6672616e 63652d70 72657373 65c07cc0 0c000c00 01000000 00000704
+     6e657773 c15dc00c 000c0001 00000000 0011036e 73320a69 6d616765 666f7275
+     6dc03fc0 0c000c00 01000000 00000704 6e657773 c196c00c 000c0001 00000000
+     0014036e 73320a69 6d616765 666f7275 6d02746d c07cc00c 000c0001 00000000
+     0007046e 657773c1 c6.
+ +0.001704
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312a8380 00010012 00000000 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001c0 0c000c00 01000000 00000d03 6e733203 61667003
+     636f6d00 c00c000c 00010000 00000005 026e73c0 3bc00c00 0c000100 00000000
+     07046e65 7773c03b c00c000c 00010000 0000000c 036e7332 03616670 02667200
+     c00c000c 00010000 00000005 026e73c0 78c00c00 0c000100 00000000 07046e65
+     7773c078 c00c000c 00010000 00000019 036e7332 12616765 6e636566 72616e63
+     65707265 737365c0 3fc00c00 0c000100 00000000 07046e65 7773c0b4 c00c000c
+     00010000 00000019 036e7332 12616765 6e636566 72616e63 65707265 737365c0
+     7cc00c00 0c000100 00000000 07046e65 7773c0ec c00c000c 00010000 0000001a
+     036e7332 13616765 6e636566 72616e63 652d7072 65737365 c03fc00c 000c0001
+     00000000 0007046e 657773c1 24c00c00 0c000100 00000000 1a036e73 32136167
+     656e6365 6672616e 63652d70 72657373 65c07cc0 0c000c00 01000000 00000704
+     6e657773 c15dc00c 000c0001 00000000 0011036e 73320a69 6d616765 666f7275
+     6dc03fc0 0c000c00 01000000 00000704 6e657773 c196c00c 000c0001 00000000
+     0014036e 73320a69 6d616765 666f7275 6d02746d c07cc00c 000c0001 00000000
+     0007046e 657773c1 c6.
+ +0.001827
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000201
+ select max=6 rfds=[4] wfds=[5] efds=[] to=29.987312
+ select=1 rfds=[] wfds=[5] efds=[]
+ +0.000364
+ read fd=5 buflen=1
+ read=EAGAIN
+ +0.000127
+ write fd=5
+     002b3123 01000001 00000000 00000134 03323034 02353003 31353807 696e2d61
+     64647204 61727061 00000c00 01.
+ write=45
+ +0.001692
+ write fd=5
+     002b312a 01000001 00000000 00000134 03323034 02353003 31353807 696e2d61
+     64647204 61727061 00000c00 01.
+ write=45
+ +0.001275
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=29.996906
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.000150
+ read fd=5 buflen=2
+ read=OK
+     02e1.
+ +0.000196
+ read fd=5 buflen=737
+ read=OK
+     31238180 00010017 00020002 01340332 30340235 30033135 3807696e 2d616464
+     72046172 70610000 0c0001c0 0c000c00 01000000 00000d03 6e733203 61667003
+     636f6d00 c00c000c 00010000 00000005 026e73c0 3bc00c00 0c000100 00000000
+     07046e65 7773c03b c00c000c 00010000 0000000c 036e7332 03616670 02667200
+     c00c000c 00010000 00000005 026e73c0 78c00c00 0c000100 00000000 07046e65
+     7773c078 c00c000c 00010000 00000019 036e7332 12616765 6e636566 72616e63
+     65707265 737365c0 3fc00c00 0c000100 00000000 07046e65 7773c0b4 c00c000c
+     00010000 00000019 036e7332 12616765 6e636566 72616e63 65707265 737365c0
+     7cc00c00 0c000100 00000000 07046e65 7773c0ec c00c000c 00010000 0000001a
+     036e7332 13616765 6e636566 72616e63 652d7072 65737365 c03fc00c 000c0001
+     00000000 0007046e 657773c1 24c00c00 0c000100 00000000 1a036e73 32136167
+     656e6365 6672616e 63652d70 72657373 65c07cc0 0c000c00 01000000 00000704
+     6e657773 c15dc00c 000c0001 00000000 0011036e 73320a69 6d616765 666f7275
+     6dc03fc0 0c000c00 01000000 00000704 6e657773 c196c00c 000c0001 00000000
+     0014036e 73320a69 6d616765 666f7275 6d02746d c07cc00c 000c0001 00000000
+     0007046e 657773c1 c6c00c00 0c000100 00000000 12036e73 320b6f6f 682d6c61
+     682d6c61 68c03fc0 0c000c00 01000000 00001203 6e73320b 61667073 6369656e
+     636573c0 3fc00c00 0c000100 00000000 0d036e73 32066166 70646f63 c03fc00c
+     000c0001 00000000 0010036e 73320961 66702d6e 6f746573 c03fc00c 000c0001
+     00000000 0011036e 73320a61 66702d64 6f6d696e 6fc03f02 35300331 35380769
+     6e2d6164 64720461 72706100 00020001 0007e8fe 0002c037 02353003 31353807
+     696e2d61 64647204 61727061 00000200 010007e8 fe000603 4e5331c0 3bc03700
+     01000100 02a2fe00 049e32cc 04034e53 31c03b00 01000100 02a2fe00 04d0dfa6
+     03.
+ +0.002595
+ read fd=5 buflen=739
+ read=OK
+     02e1312a 81800001 00170002 00020134 03323034 02353003 31353807 696e2d61
+     64647204 61727061 00000c00 01c00c00 0c000100 00000000 0d036e73 32036166
+     7003636f 6d00c00c 000c0001 00000000 0005026e 73c03bc0 0c000c00 01000000
+     00000704 6e657773 c03bc00c 000c0001 00000000 000c036e 73320361 66700266
+     7200c00c 000c0001 00000000 0005026e 73c078c0 0c000c00 01000000 00000704
+     6e657773 c078c00c 000c0001 00000000 0019036e 73321261 67656e63 65667261
+     6e636570 72657373 65c03fc0 0c000c00 01000000 00000704 6e657773 c0b4c00c
+     000c0001 00000000 0019036e 73321261 67656e63 65667261 6e636570 72657373
+     65c07cc0 0c000c00 01000000 00000704 6e657773 c0ecc00c 000c0001 00000000
+     001a036e 73321361 67656e63 65667261 6e63652d 70726573 7365c03f c00c000c
+     00010000 00000007 046e6577 73c124c0 0c000c00 01000000 00001a03 6e733213
+     6167656e 63656672 616e6365 2d707265 737365c0 7cc00c00 0c000100 00000000
+     07046e65 7773c15d c00c000c 00010000 00000011 036e7332 0a696d61 6765666f
+     72756dc0 3fc00c00 0c000100 00000000 07046e65 7773c196 c00c000c 00010000
+     00000014 036e7332 0a696d61 6765666f 72756d02 746dc07c c00c000c 00010000
+     00000007 046e6577 73c1c6c0 0c000c00 01000000 00001203 6e73320b 6f6f682d
+     6c61682d 6c6168c0 3fc00c00 0c000100 00000000 12036e73 320b6166 70736369
+     656e6365 73c03fc0 0c000c00 01000000 00000d03 6e733206 61667064 6f63c03f
+     c00c000c 00010000 00000010 036e7332 09616670 2d6e6f74 6573c03f c00c000c
+     00010000 00000011 036e7332 0a616670 2d646f6d 696e6fc0 3f023530 03313538
+     07696e2d 61646472 04617270 61000002 00010007 e8fe0002 c0370235 30033135
+     3807696e 2d616464 72046172 70610000 02000100 07e8fe00 06034e53 31c03bc0
+     37000100 010002a2 fe00049e 32cc0403 4e5331c0 3b000100 010002a2 fe0004d0
+     dfa603.
+ +0.004644
+ sendto fd=4 addr=172.18.45.6:53
+     312e0100 00010000 00000000 036e7332 03616670 03636f6d 00000100 01.
+ sendto=29
+ +0.001410
+ sendto fd=4 addr=172.18.45.6:53
+     312f0100 00010000 00000000 026e7303 61667003 636f6d00 00010001.
+ sendto=28
+ +0.001075
+ sendto fd=4 addr=172.18.45.6:53
+     31300100 00010000 00000000 046e6577 73036166 7003636f 6d000001 0001.
+ sendto=30
+ +0.001072
+ sendto fd=4 addr=172.18.45.6:53
+     31310100 00010000 00000000 036e7332 03616670 02667200 00010001.
+ sendto=28
+ +0.001053
+ sendto fd=4 addr=172.18.45.6:53
+     31320100 00010000 00000000 026e7303 61667002 66720000 010001.
+ sendto=27
+ +0.001065
+ sendto fd=4 addr=172.18.45.6:53
+     31330100 00010000 00000000 046e6577 73036166 70026672 00000100 01.
+ sendto=29
+ +0.001063
+ sendto fd=4 addr=172.18.45.6:53
+     31340100 00010000 00000000 036e7332 12616765 6e636566 72616e63 65707265
+     73736503 636f6d00 00010001.
+ sendto=44
+ +0.001117
+ sendto fd=4 addr=172.18.45.6:53
+     31350100 00010000 00000000 046e6577 73126167 656e6365 6672616e 63657072
+     65737365 03636f6d 00000100 01.
+ sendto=45
+ +0.001230
+ sendto fd=4 addr=172.18.45.6:53
+     31360100 00010000 00000000 036e7332 12616765 6e636566 72616e63 65707265
+     73736502 66720000 010001.
+ sendto=43
+ +0.001352
+ sendto fd=4 addr=172.18.45.6:53
+     31370100 00010000 00000000 046e6577 73126167 656e6365 6672616e 63657072
+     65737365 02667200 00010001.
+ sendto=44
+ +0.001324
+ sendto fd=4 addr=172.18.45.6:53
+     31380100 00010000 00000000 036e7332 13616765 6e636566 72616e63 652d7072
+     65737365 03636f6d 00000100 01.
+ sendto=45
+ +0.001336
+ sendto fd=4 addr=172.18.45.6:53
+     31390100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+     72657373 6503636f 6d000001 0001.
+ sendto=46
+ +0.001340
+ sendto fd=4 addr=172.18.45.6:53
+     313a0100 00010000 00000000 036e7332 13616765 6e636566 72616e63 652d7072
+     65737365 02667200 00010001.
+ sendto=44
+ +0.001322
+ sendto fd=4 addr=172.18.45.6:53
+     313b0100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+     72657373 65026672 00000100 01.
+ sendto=45
+ +0.001312
+ sendto fd=4 addr=172.18.45.6:53
+     313c0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d03 636f6d00
+     00010001.
+ sendto=36
+ +0.001330
+ sendto fd=4 addr=172.18.45.6:53
+     313d0100 00010000 00000000 046e6577 730a696d 61676566 6f72756d 03636f6d
+     00000100 01.
+ sendto=37
+ +0.001298
+ sendto fd=4 addr=172.18.45.6:53
+     313e0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d02 746d0266
+     72000001 0001.
+ sendto=38
+ +0.001326
+ sendto fd=4 addr=172.18.45.6:53
+     313f0100 00010000 00000000 046e6577 730a696d 61676566 6f72756d 02746d02
+     66720000 010001.
+ sendto=39
+ +0.001310
+ sendto fd=4 addr=172.18.45.6:53
+     31400100 00010000 00000000 036e7332 0b6f6f68 2d6c6168 2d6c6168 03636f6d
+     00000100 01.
+ sendto=37
+ +0.001326
+ sendto fd=4 addr=172.18.45.6:53
+     31410100 00010000 00000000 036e7332 0b616670 73636965 6e636573 03636f6d
+     00000100 01.
+ sendto=37
+ +0.001329
+ sendto fd=4 addr=172.18.45.6:53
+     31420100 00010000 00000000 036e7332 06616670 646f6303 636f6d00 00010001.
+ sendto=32
+ +0.001283
+ sendto fd=4 addr=172.18.45.6:53
+     31430100 00010000 00000000 036e7332 09616670 2d6e6f74 65730363 6f6d0000
+     010001.
+ sendto=35
+ +0.001386
+ sendto fd=4 addr=172.18.45.6:53
+     31440100 00010000 00000000 036e7332 0a616670 2d646f6d 696e6f03 636f6d00
+     00010001.
+ sendto=36
+ +0.001512
+ read fd=5 buflen=739
+ read=EAGAIN
+ +0.000090
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.963304
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.004077
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312e8180 00010001 000d000d 036e7332 03616670 03636f6d 00000100 01c00c00
+     01000100 02813e00 049e32cc 04000002 00010007 e8df0014 014c0c52 4f4f542d
+     53455256 45525303 4e455400 00000200 010007e8 df000401 4dc03a00 00020001
+     0007e8df 00040149 c03a0000 02000100 07e8df00 040145c0 3a000002 00010007
+     e8df0004 0144c03a 00000200 010007e8 df000401 41c03a00 00020001 0007e8df
+     00040148 c03a0000 02000100 07e8df00 040143c0 3a000002 00010007 e8df0004
+     0147c03a 00000200 010007e8 df000401 46c03a00 00020001 0007e8df 00040142
+     c03a0000 02000100 07e8df00 04014ac0 3a000002 00010007 e8df0004 014bc03a
+     c0380001 00010009 3a5f0004 c620400c c0570001 00010009 3a5f0004 ca0c1b21
+     c0660001 00010009 3a5f0004 c0249411 c0750001 00010009 3a5f0004 c0cbe60a
+     c0840001 00010009 3a5f0004 80080a5a c0930001 00010009 3a5f0004 c6290004
+     c0a20001 00010009 3a5f0004 803f0235 c0b10001 00010009 3a5f0004 c021040c
+     c0c00001 00010009 3a5f0004 c0702404 c0cf0001 00010009 3a5f0004 c00505f1
+     c0de0001 00010009 3a5f0004 8009006b c0ed0001 00010009 3a5f0004 c629000a
+     c0fc0001 00010009 3a5f0004 c1000e81.
+ +0.001847
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000277
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.957103
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-40545
+ sendto fd=4 addr=172.18.45.6:53
+     312f0100 00010000 00000000 026e7303 61667003 636f6d00 00010001.
+ sendto=28
+ +0.000601
+ sendto fd=4 addr=172.18.45.6:53
+     31300100 00010000 00000000 046e6577 73036166 7003636f 6d000001 0001.
+ sendto=30
+ +0.000404
+ sendto fd=4 addr=172.18.45.6:53
+     31310100 00010000 00000000 036e7332 03616670 02667200 00010001.
+ sendto=28
+ +0.000424
+ sendto fd=4 addr=172.18.45.6:53
+     31320100 00010000 00000000 026e7303 61667002 66720000 010001.
+ sendto=27
+ +0.000383
+ sendto fd=4 addr=172.18.45.6:53
+     31330100 00010000 00000000 046e6577 73036166 70026672 00000100 01.
+ sendto=29
+ +0.000389
+ sendto fd=4 addr=172.18.45.6:53
+     31340100 00010000 00000000 036e7332 12616765 6e636566 72616e63 65707265
+     73736503 636f6d00 00010001.
+ sendto=44
+ +0.000446
+ sendto fd=4 addr=172.18.45.6:53
+     31350100 00010000 00000000 046e6577 73126167 656e6365 6672616e 63657072
+     65737365 03636f6d 00000100 01.
+ sendto=45
+ +0.000449
+ sendto fd=4 addr=172.18.45.6:53
+     31360100 00010000 00000000 036e7332 12616765 6e636566 72616e63 65707265
+     73736502 66720000 010001.
+ sendto=43
+ +0.000440
+ sendto fd=4 addr=172.18.45.6:53
+     31370100 00010000 00000000 046e6577 73126167 656e6365 6672616e 63657072
+     65737365 02667200 00010001.
+ sendto=44
+ +0.000441
+ sendto fd=4 addr=172.18.45.6:53
+     31380100 00010000 00000000 036e7332 13616765 6e636566 72616e63 652d7072
+     65737365 03636f6d 00000100 01.
+ sendto=45
+ +0.000474
+ sendto fd=4 addr=172.18.45.6:53
+     31390100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+     72657373 6503636f 6d000001 0001.
+ sendto=46
+ +0.000451
+ sendto fd=4 addr=172.18.45.6:53
+     313a0100 00010000 00000000 036e7332 13616765 6e636566 72616e63 652d7072
+     65737365 02667200 00010001.
+ sendto=44
+ +0.000440
+ sendto fd=4 addr=172.18.45.6:53
+     313b0100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+     72657373 65026672 00000100 01.
+ sendto=45
+ +0.000439
+ sendto fd=4 addr=172.18.45.6:53
+     313c0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d03 636f6d00
+     00010001.
+ sendto=36
+ +0.000413
+ sendto fd=4 addr=172.18.45.6:53
+     313d0100 00010000 00000000 046e6577 730a696d 61676566 6f72756d 03636f6d
+     00000100 01.
+ sendto=37
+ +0.000416
+ sendto fd=4 addr=172.18.45.6:53
+     313e0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d02 746d0266
+     72000001 0001.
+ sendto=38
+ +0.000442
+ sendto fd=4 addr=172.18.45.6:53
+     313f0100 00010000 00000000 046e6577 730a696d 61676566 6f72756d 02746d02
+     66720000 010001.
+ sendto=39
+ +0.000418
+ sendto fd=4 addr=172.18.45.6:53
+     31400100 00010000 00000000 036e7332 0b6f6f68 2d6c6168 2d6c6168 03636f6d
+     00000100 01.
+ sendto=37
+ +0.000412
+ sendto fd=4 addr=172.18.45.6:53
+     31410100 00010000 00000000 036e7332 0b616670 73636965 6e636573 03636f6d
+     00000100 01.
+ sendto=37
+ +0.000413
+ sendto fd=4 addr=172.18.45.6:53
+     31420100 00010000 00000000 036e7332 06616670 646f6303 636f6d00 00010001.
+ sendto=32
+ +0.000394
+ sendto fd=4 addr=172.18.45.6:53
+     31430100 00010000 00000000 036e7332 09616670 2d6e6f74 65730363 6f6d0000
+     010001.
+ sendto=35
+ +0.000403
+ sendto fd=4 addr=172.18.45.6:53
+     31440100 00010000 00000000 036e7332 0a616670 2d646f6d 696e6f03 636f6d00
+     00010001.
+ sendto=36
+ +0.000407
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.990501
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-09491
+ sendto fd=4 addr=172.18.45.6:53
+     312f0100 00010000 00000000 026e7303 61667003 636f6d00 00010001.
+ sendto=28
+ +0.000642
+ sendto fd=4 addr=172.18.45.6:53
+     31300100 00010000 00000000 046e6577 73036166 7003636f 6d000001 0001.
+ sendto=30
+ +0.000399
+ sendto fd=4 addr=172.18.45.6:53
+     31310100 00010000 00000000 036e7332 03616670 02667200 00010001.
+ sendto=28
+ +0.000385
+ sendto fd=4 addr=172.18.45.6:53
+     31320100 00010000 00000000 026e7303 61667002 66720000 010001.
+ sendto=27
+ +0.000380
+ sendto fd=4 addr=172.18.45.6:53
+     31330100 00010000 00000000 046e6577 73036166 70026672 00000100 01.
+ sendto=29
+ +0.000388
+ sendto fd=4 addr=172.18.45.6:53
+     31340100 00010000 00000000 036e7332 12616765 6e636566 72616e63 65707265
+     73736503 636f6d00 00010001.
+ sendto=44
+ +0.000443
+ sendto fd=4 addr=172.18.45.6:53
+     31350100 00010000 00000000 046e6577 73126167 656e6365 6672616e 63657072
+     65737365 03636f6d 00000100 01.
+ sendto=45
+ +0.000447
+ sendto fd=4 addr=172.18.45.6:53
+     31360100 00010000 00000000 036e7332 12616765 6e636566 72616e63 65707265
+     73736502 66720000 010001.
+ sendto=43
+ +0.000456
+ sendto fd=4 addr=172.18.45.6:53
+     31370100 00010000 00000000 046e6577 73126167 656e6365 6672616e 63657072
+     65737365 02667200 00010001.
+ sendto=44
+ +0.000438
+ sendto fd=4 addr=172.18.45.6:53
+     31380100 00010000 00000000 036e7332 13616765 6e636566 72616e63 652d7072
+     65737365 03636f6d 00000100 01.
+ sendto=45
+ +0.000445
+ sendto fd=4 addr=172.18.45.6:53
+     31390100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+     72657373 6503636f 6d000001 0001.
+ sendto=46
+ +0.000447
+ sendto fd=4 addr=172.18.45.6:53
+     313a0100 00010000 00000000 036e7332 13616765 6e636566 72616e63 652d7072
+     65737365 02667200 00010001.
+ sendto=44
+ +0.000437
+ sendto fd=4 addr=172.18.45.6:53
+     313b0100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+     72657373 65026672 00000100 01.
+ sendto=45
+ +0.000438
+ sendto fd=4 addr=172.18.45.6:53
+     313c0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d03 636f6d00
+     00010001.
+ sendto=36
+ +0.000434
+ sendto fd=4 addr=172.18.45.6:53
+     313d0100 00010000 00000000 046e6577 730a696d 61676566 6f72756d 03636f6d
+     00000100 01.
+ sendto=37
+ +0.000416
+ sendto fd=4 addr=172.18.45.6:53
+     313e0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d02 746d0266
+     72000001 0001.
+ sendto=38
+ +0.000415
+ sendto fd=4 addr=172.18.45.6:53
+     313f0100 00010000 00000000 046e6577 730a696d 61676566 6f72756d 02746d02
+     66720000 010001.
+ sendto=39
+ +0.000416
+ sendto fd=4 addr=172.18.45.6:53
+     31400100 00010000 00000000 036e7332 0b6f6f68 2d6c6168 2d6c6168 03636f6d
+     00000100 01.
+ sendto=37
+ +0.000412
+ sendto fd=4 addr=172.18.45.6:53
+     31410100 00010000 00000000 036e7332 0b616670 73636965 6e636573 03636f6d
+     00000100 01.
+ sendto=37
+ +0.000414
+ sendto fd=4 addr=172.18.45.6:53
+     31420100 00010000 00000000 036e7332 06616670 646f6303 636f6d00 00010001.
+ sendto=32
+ +0.000392
+ sendto fd=4 addr=172.18.45.6:53
+     31430100 00010000 00000000 036e7332 09616670 2d6e6f74 65730363 6f6d0000
+     010001.
+ sendto=35
+ +0.000425
+ sendto fd=4 addr=172.18.45.6:53
+     31440100 00010000 00000000 036e7332 0a616670 2d646f6d 696e6f03 636f6d00
+     00010001.
+ sendto=36
+ +0.000409
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.990522
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-235306
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312f8580 00010001 00020002 026e7303 61667003 636f6d00 00010001 c00c0001
+     00010001 51800004 9e32cc04 03616670 03636f6d 00000200 01000151 80000603
+     6e7332c0 2cc02c00 02000100 01518000 06036e73 31c02cc0 3f000100 01000151
+     8000049e 32cc04c0 51000100 01000151 800004d0 dfa603.
+ +0.000734
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000269
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.224825
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.179062
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31448580 00010001 00020002 036e7332 0a616670 2d646f6d 696e6f03 636f6d00
+     00010001 c00c0001 00010001 51800004 9e32cc04 0a616670 2d646f6d 696e6f03
+     636f6d00 00020001 00015180 0002c00c c0340002 00010001 51800006 036e7331
+     c034c00c 00010001 00015180 00049e32 cc04c05c 00010001 00015180 0004d0df
+     a603.
+ +0.000758
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000284
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.044721
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038932
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31438580 00010001 00020002 036e7332 09616670 2d6e6f74 65730363 6f6d0000
+     010001c0 0c000100 01000151 8000049e 32cc0409 6166702d 6e6f7465 7303636f
+     6d000002 00010001 51800002 c00cc033 00020001 00015180 0006036e 7331c033
+     c00c0001 00010001 51800004 9e32cc04 c05a0001 00010001 51800004 d0dfa603.
+ +0.000729
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000258
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.004802
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.399140
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     313a8180 00010001 00020002 036e7332 13616765 6e636566 72616e63 652d7072
+     65737365 02667200 00010001 c00c0001 00010005 46000004 9e32cc04 13616765
+     6e636566 72616e63 652d7072 65737365 02667200 00020001 00054600 0002c00c
+     c03c0002 00010005 46000006 036e7331 c03cc00c 00010001 00054600 00049e32
+     cc04c06c 00010001 00054600 0004d0df a603.
+ +0.000770
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000288
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.604604
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038862
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     313d8580 00010001 00020002 046e6577 730a696d 61676566 6f72756d 03636f6d
+     00000100 01c00c00 01000100 01518000 049e32cc 040a696d 61676566 6f72756d
+     03636f6d 00000200 01000151 80000603 6e7332c0 35c03500 02000100 01518000
+     06036e73 31c035c0 4f000100 01000151 8000049e 32cc04c0 61000100 01000151
+     800004d0 dfa603.
+ +0.000714
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000248
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.564780
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-870685
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31358580 00010001 00020002 046e6577 73126167 656e6365 6672616e 63657072
+     65737365 03636f6d 00000100 01c00c00 01000100 01518000 049e32cc 04126167
+     656e6365 6672616e 63657072 65737365 03636f6d 00000200 01000151 80000603
+     6e7332c0 3dc03d00 02000100 01518000 06036e73 31c03dc0 5f000100 01000151
+     8000049e 32cc04c0 71000100 01000151 800004d0 dfa603.
+ +0.000749
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000248
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.434468
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038661
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31348580 00010001 00020002 036e7332 12616765 6e636566 72616e63 65707265
+     73736503 636f6d00 00010001 c00c0001 00010001 51800004 9e32cc04 12616765
+     6e636566 72616e63 65707265 73736503 636f6d00 00020001 00015180 0002c00c
+     c03c0002 00010001 51800006 036e7331 c03cc00c 00010001 00015180 00049e32
+     cc04c06c 00010001 00015180 0004d0df a603.
+ +0.000722
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000266
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.394819
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.049154
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31368180 00010001 00020002 036e7332 12616765 6e636566 72616e63 65707265
+     73736502 66720000 010001c0 0c000100 01000546 0000049e 32cc0412 6167656e
+     63656672 616e6365 70726573 73650266 72000002 00010005 46000002 c00cc03b
+     00020001 00054600 0006036e 7331c03b c00c0001 00010005 46000004 9e32cc04
+     c06a0001 00010005 46000004 d0dfa603.
+ +0.000707
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000243
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.344715
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039336
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31388580 00010001 00020002 036e7332 13616765 6e636566 72616e63 652d7072
+     65737365 03636f6d 00000100 01c00c00 01000100 01518000 049e32cc 04136167
+     656e6365 6672616e 63652d70 72657373 6503636f 6d000002 00010001 51800002
+     c00cc03d 00020001 00015180 0006036e 7331c03d c00c0001 00010001 51800004
+     9e32cc04 c06e0001 00010001 51800004 d0dfa603.
+ +0.000695
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000267
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.304417
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.078532
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31308580 00010001 00020002 046e6577 73036166 7003636f 6d000001 0001c00c
+     00010001 00015180 00049e32 cc040361 66700363 6f6d0000 02000100 01518000
+     06036e73 32c02ec0 2e000200 01000151 80000603 6e7331c0 2ec04100 01000100
+     01518000 049e32cc 04c05300 01000100 01518000 04d0dfa6 03.
+ +0.000600
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000235
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.225050
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039210
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31318180 00010001 00020002 036e7332 03616670 02667200 00010001 c00c0001
+     00010005 46000004 9e32cc04 03616670 02667200 00020001 00054600 0002c00c
+     c02c0002 00010005 46000006 036e7331 c02cc00c 00010001 00054600 00049e32
+     cc04c04c 00010001 00054600 0004d0df a603.
+ +0.000589
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000236
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.185015
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.159098
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31378180 00010001 00010001 046e6577 73126167 656e6365 6672616e 63657072
+     65737365 02667200 00010001 c00c0001 00010000 00000004 9e32cc04 12616765
+     6e636566 72616e63 65707265 73736502 66720000 02000100 00000000 06036e73
+     31c03cc0 5d000100 01000000 000004d0 dfa603.
+ +0.000578
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000253
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.025086
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.025066
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=0.000020
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009997
+ sendto fd=4 addr=172.18.45.6:53
+     31320100 00010000 00000000 026e7303 61667002 66720000 010001.
+ sendto=27
+ +0.000458
+ sendto fd=4 addr=172.18.45.6:53
+     31330100 00010000 00000000 046e6577 73036166 70026672 00000100 01.
+ sendto=29
+ +0.000387
+ sendto fd=4 addr=172.18.45.6:53
+     31390100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+     72657373 6503636f 6d000001 0001.
+ sendto=46
+ +0.000441
+ sendto fd=4 addr=172.18.45.6:53
+     313b0100 00010000 00000000 046e6577 73136167 656e6365 6672616e 63652d70
+     72657373 65026672 00000100 01.
+ sendto=45
+ +0.000438
+ sendto fd=4 addr=172.18.45.6:53
+     313c0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d03 636f6d00
+     00010001.
+ sendto=36
+ +0.000561
+ sendto fd=4 addr=172.18.45.6:53
+     313e0100 00010000 00000000 036e7332 0a696d61 6765666f 72756d02 746d0266
+     72000001 0001.
+ sendto=38
+ +0.000423
+ sendto fd=4 addr=172.18.45.6:53
+     313f0100 00010000 00000000 046e6577 730a696d 61676566 6f72756d 02746d02
+     66720000 010001.
+ sendto=39
+ +0.000446
+ sendto fd=4 addr=172.18.45.6:53
+     31400100 00010000 00000000 036e7332 0b6f6f68 2d6c6168 2d6c6168 03636f6d
+     00000100 01.
+ sendto=37
+ +0.000418
+ sendto fd=4 addr=172.18.45.6:53
+     31410100 00010000 00000000 036e7332 0b616670 73636965 6e636573 03636f6d
+     00000100 01.
+ sendto=37
+ +0.000584
+ sendto fd=4 addr=172.18.45.6:53
+     31420100 00010000 00000000 036e7332 06616670 646f6303 636f6d00 00010001.
+ sendto=32
+ +0.000560
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.995284
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.000226
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     313c8180 00010001 00020002 036e7332 0a696d61 6765666f 72756d03 636f6d00
+     00010001 c00c0001 00010001 409f0004 9e32cc04 0a696d61 6765666f 72756d03
+     434f4d00 00020001 0001517f 0002c00c c0340002 00010001 517f0006 036e7331
+     c034c00c 00010001 0001409f 00049e32 cc04c05c 00010001 0001517f 0004d0df
+     a603.
+ +0.000582
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000266
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.994210
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.168328
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31328180 00010001 00010001 026e7303 61667002 66720000 010001c0 0c000100
+     01000000 0000049e 32cc0403 61667002 66720000 02000100 00000000 06036e73
+     31c02bc0 3d000100 01000000 000004d0 dfa603.
+ +0.000470
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000252
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=1.825160
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.229075
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31428580 00010000 00010000 036e7332 06616670 646f6303 636f6d00 00010001
+     06616670 646f6303 636f6d00 00060001 00015180 002c0364 6e730876 6963746f
+     69726502 66720004 726f6f74 c03a7727 65890000 70800000 1c20004f 1a000001
+     5180.
+ +0.000492
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.001505
+ close fd=4
+ close=OK
+ +0.000260
+ close fd=5
+ close=OK
+ +0.000401
Index: adns/regress/case-norecurse3.out
diff -u /dev/null adns/regress/case-norecurse3.out:1.4
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/regress/case-norecurse3.out	Tue Oct 12 22:38:23 1999
@@ -0,0 +1,32 @@
+adns debug: using nameserver 172.18.45.6
+2.203.156.195.in-addr.arpa1 flags 0 type 1 A(-) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 2 NS(raw) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 5 CNAME(-) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 6 SOA(raw) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 12 PTR(raw) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 13 HINFO(-) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 15 MX(raw) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 16 TXT(-) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 17 RP(raw) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 65537 A(addr) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 65538 NS(+addr) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 65548 PTR(checked) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 65551 MX(+addr) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 131078 SOA(822) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type 131089 RP(822) submitted
+2.203.156.195.in-addr.arpa1 flags 0 type A(-): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type RP(822): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type SOA(822): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type MX(+addr): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type PTR(checked): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type NS(+addr): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type A(addr): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type RP(raw): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type TXT(-): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type MX(raw): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type HINFO(-): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type PTR(raw): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type SOA(raw): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type CNAME(-): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+2.203.156.195.in-addr.arpa1 flags 0 type NS(raw): No such domain; nrrs=0; cname=$; owner=$; ttl=86400
+rc=0
Index: adns/regress/case-norecurse3.sys
diff -u /dev/null adns/regress/case-norecurse3.sys:1.4
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/regress/case-norecurse3.sys	Tue Oct 12 22:38:23 1999
@@ -0,0 +1,504 @@
+default -0x16
+2.203.156.195.in-addr.arpa1
+ start 939764258.086555
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000189
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000054
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000041
+ sendto fd=4 addr=172.18.45.6:53
+     311f0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000100 01.
+ sendto=45
+ +0.002044
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000133
+ sendto fd=4 addr=172.18.45.6:53
+     31200100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000200 01.
+ sendto=45
+ +0.001173
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000092
+ sendto fd=4 addr=172.18.45.6:53
+     31210100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000500 01.
+ sendto=45
+ +0.001197
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000095
+ sendto fd=4 addr=172.18.45.6:53
+     31220100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000600 01.
+ sendto=45
+ +0.001228
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000095
+ sendto fd=4 addr=172.18.45.6:53
+     31230100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000c00 01.
+ sendto=45
+ +0.001194
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000095
+ sendto fd=4 addr=172.18.45.6:53
+     31240100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000d00 01.
+ sendto=45
+ +0.001205
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000099
+ sendto fd=4 addr=172.18.45.6:53
+     31250100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000f00 01.
+ sendto=45
+ +0.001196
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000104
+ sendto fd=4 addr=172.18.45.6:53
+     31260100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00001000 01.
+ sendto=45
+ +0.001186
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000122
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00001100 01.
+ sendto=45
+ +0.001225
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000104
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000100 01.
+ sendto=45
+ +0.001179
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000112
+ sendto fd=4 addr=172.18.45.6:53
+     31290100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000200 01.
+ sendto=45
+ +0.001344
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000109
+ sendto fd=4 addr=172.18.45.6:53
+     312a0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000c00 01.
+ sendto=45
+ +0.001205
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000113
+ sendto fd=4 addr=172.18.45.6:53
+     312b0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000f00 01.
+ sendto=45
+ +0.001214
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000118
+ sendto fd=4 addr=172.18.45.6:53
+     312c0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000600 01.
+ sendto=45
+ +0.001221
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000120
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00001100 01.
+ sendto=45
+ +0.001203
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000129
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.979346
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-26085
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.005431
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.009976
+ sendto fd=4 addr=172.18.45.6:53
+     311f0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000100 01.
+ sendto=45
+ +0.000545
+ sendto fd=4 addr=172.18.45.6:53
+     31200100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000200 01.
+ sendto=45
+ +0.000472
+ sendto fd=4 addr=172.18.45.6:53
+     31210100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000500 01.
+ sendto=45
+ +0.000438
+ sendto fd=4 addr=172.18.45.6:53
+     31220100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000600 01.
+ sendto=45
+ +0.000483
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000057
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008066
+ sendto fd=4 addr=172.18.45.6:53
+     31230100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000c00 01.
+ sendto=45
+ +0.000453
+ sendto fd=4 addr=172.18.45.6:53
+     31240100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000d00 01.
+ sendto=45
+ +0.000438
+ sendto fd=4 addr=172.18.45.6:53
+     31250100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000f00 01.
+ sendto=45
+ +0.000454
+ sendto fd=4 addr=172.18.45.6:53
+     31260100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00001000 01.
+ sendto=45
+ +0.000434
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00001100 01.
+ sendto=45
+ +0.000433
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000100 01.
+ sendto=45
+ +0.000435
+ sendto fd=4 addr=172.18.45.6:53
+     31290100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000200 01.
+ sendto=45
+ +0.000829
+ sendto fd=4 addr=172.18.45.6:53
+     312a0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000c00 01.
+ sendto=45
+ +0.000488
+ sendto fd=4 addr=172.18.45.6:53
+     312b0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000f00 01.
+ sendto=45
+ +0.000457
+ sendto fd=4 addr=172.18.45.6:53
+     312c0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000600 01.
+ sendto=45
+ +0.000430
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.001297
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.005148
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00001100 01.
+ sendto=45
+ +0.000447
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.979550
+ select=0 rfds=[] wfds=[] efds=[]
+ +2.-20428
+ sendto fd=4 addr=172.18.45.6:53
+     311f0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000100 01.
+ sendto=45
+ +0.000564
+ sendto fd=4 addr=172.18.45.6:53
+     31200100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000200 01.
+ sendto=45
+ +0.000441
+ sendto fd=4 addr=172.18.45.6:53
+     31210100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000500 01.
+ sendto=45
+ +0.000455
+ sendto fd=4 addr=172.18.45.6:53
+     31220100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000600 01.
+ sendto=45
+ +0.000483
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.008522
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.008039
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000000
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.000145
+ sendto fd=4 addr=172.18.45.6:53
+     31230100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000c00 01.
+ sendto=45
+ +0.000448
+ sendto fd=4 addr=172.18.45.6:53
+     31240100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000d00 01.
+ sendto=45
+ +0.000434
+ sendto fd=4 addr=172.18.45.6:53
+     31250100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000f00 01.
+ sendto=45
+ +0.000431
+ sendto fd=4 addr=172.18.45.6:53
+     31260100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00001000 01.
+ sendto=45
+ +0.000454
+ sendto fd=4 addr=172.18.45.6:53
+     31270100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00001100 01.
+ sendto=45
+ +0.000434
+ sendto fd=4 addr=172.18.45.6:53
+     31280100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000100 01.
+ sendto=45
+ +0.000434
+ sendto fd=4 addr=172.18.45.6:53
+     31290100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000200 01.
+ sendto=45
+ +0.000428
+ select max=5 rfds=[4] wfds=[] efds=[] to=0.000268
+ select=0 rfds=[] wfds=[] efds=[]
+ +0.006792
+ sendto fd=4 addr=172.18.45.6:53
+     312a0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000c00 01.
+ sendto=45
+ +0.000445
+ sendto fd=4 addr=172.18.45.6:53
+     312b0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000f00 01.
+ sendto=45
+ +0.000431
+ sendto fd=4 addr=172.18.45.6:53
+     312c0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000600 01.
+ sendto=45
+ +0.000461
+ sendto fd=4 addr=172.18.45.6:53
+     312d0100 00010000 00000000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00001100 01.
+ sendto=45
+ +0.000432
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.978249
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.291904
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     311f8583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000100 01000006 00010001 5180003e 01410c52 4f4f542d
+     53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+     c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000689
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000167
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.685489
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.038802
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312d8583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00001100 01000006 00010001 5180003e 01410c52 4f4f542d
+     53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+     c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000514
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000165
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.646008
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.099281
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312c8583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000600 01000006 00010001 5180003e 01410c52 4f4f542d
+     53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+     c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000520
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000145
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.546062
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039368
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312b8583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000f00 01000006 00010001 5180003e 01410c52 4f4f542d
+     53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+     c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000535
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000134
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.506025
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039372
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     312a8583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000c00 01000006 00010001 5180003e 01410c52 4f4f542d
+     53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+     c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000507
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000132
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.466014
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039305
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31298583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000200 01000006 00010001 5180003e 01410c52 4f4f542d
+     53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+     c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000538
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000132
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.426039
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039291
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31288583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000100 01000006 00010001 5180003e 01410c52 4f4f542d
+     53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+     c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000502
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000132
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.386114
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039825
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31278583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00001100 01000006 00010001 5180003e 01410c52 4f4f542d
+     53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+     c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000500
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000131
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.345658
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039138
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31268583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00001000 01000006 00010001 5180003e 01410c52 4f4f542d
+     53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+     c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000498
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000132
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.305890
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039192
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31258583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000f00 01000006 00010001 5180003e 01410c52 4f4f542d
+     53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+     c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000495
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000130
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.266073
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039369
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31248583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000d00 01000006 00010001 5180003e 01410c52 4f4f542d
+     53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+     c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000494
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000149
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.226061
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039356
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31238583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000c00 01000006 00010001 5180003e 01410c52 4f4f542d
+     53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+     c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000493
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000130
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.186082
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039358
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31228583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000600 01000006 00010001 5180003e 01410c52 4f4f542d
+     53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+     c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000490
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000157
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.146077
+ select=1 rfds=[4] wfds=[] efds=[]
+ +0.039772
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31218583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000500 01000006 00010001 5180003e 01410c52 4f4f542d
+     53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+     c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000496
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000131
+ select max=5 rfds=[4] wfds=[] efds=[] to=1.105678
+ select=1 rfds=[4] wfds=[] efds=[]
+ +1.-960894
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=OK addr=172.18.45.6:53
+     31208583 00010000 00010000 01320332 30330331 35360331 39350769 6e2d6164
+     64720561 72706131 00000200 01000006 00010001 5180003e 01410c52 4f4f542d
+     53455256 45525303 4e455400 0a686f73 746d6173 74657208 696e7465 726e6963
+     c0477727 dd100000 07080000 03840009 3a800001 5180.
+ +0.000487
+ recvfrom fd=4 buflen=512 *addrlen=16
+ recvfrom=EAGAIN
+ +0.000143
+ close fd=4
+ close=OK
+ +0.000235
Index: adns/regress/case-owner.out
diff -u adns/regress/case-owner.out:1.3 adns/regress/case-owner.out:1.6
--- adns/regress/case-owner.out:1.3	Thu Jul 29 00:59:31 1999
+++ adns/regress/case-owner.out	Wed Oct 13 01:27:05 1999
@@ -22,15 +22,15 @@
 chiark.greenend.org.uk flags 4 type PTR(raw): No such data; nrrs=0; cname=$; owner=chiark.greenend.org.uk; ttl=86400
 chiark.greenend.org.uk flags 4 type HINFO(-): No such data; nrrs=0; cname=$; owner=chiark.greenend.org.uk; ttl=86400
 chiark.greenend.org.uk flags 4 type MX(raw): OK; nrrs=1; cname=$; owner=chiark.greenend.org.uk; ttl=86400
- 5 "permutation-city.greenend.org.uk"
+ 5 permutation-city.greenend.org.uk
 chiark.greenend.org.uk flags 4 type TXT(-): No such data; nrrs=0; cname=$; owner=chiark.greenend.org.uk; ttl=86400
 chiark.greenend.org.uk flags 4 type RP(raw): No such data; nrrs=0; cname=$; owner=chiark.greenend.org.uk; ttl=86400
 chiark.greenend.org.uk flags 4 type A(addr): OK; nrrs=1; cname=$; owner=chiark.greenend.org.uk; ttl=86400
- AF_INET 195.224.76.132
+ INET 195.224.76.132
 chiark.greenend.org.uk flags 4 type NS(+addr): No such data; nrrs=0; cname=$; owner=chiark.greenend.org.uk; ttl=86400
 chiark.greenend.org.uk flags 4 type PTR(checked): No such data; nrrs=0; cname=$; owner=chiark.greenend.org.uk; ttl=86400
 chiark.greenend.org.uk flags 4 type MX(+addr): OK; nrrs=1; cname=$; owner=chiark.greenend.org.uk; ttl=86400
- 5 "permutation-city.greenend.org.uk": AF_INET 195.224.76.134
+ 5 permutation-city.greenend.org.uk ok 0 ok "OK" ( INET 195.224.76.134 )
 chiark.greenend.org.uk flags 4 type SOA(822): No such data; nrrs=0; cname=$; owner=chiark.greenend.org.uk; ttl=86400
 chiark.greenend.org.uk flags 4 type RP(822): No such data; nrrs=0; cname=$; owner=chiark.greenend.org.uk; ttl=86400
 rc=0
Index: adns/regress/case-rootquery.out
diff -u adns/regress/case-rootquery.out:1.2 adns/regress/case-rootquery.out:1.3
--- adns/regress/case-rootquery.out:1.2	Sat Apr 17 17:23:17 1999
+++ adns/regress/case-rootquery.out	Sat Aug 14 19:54:32 1999
@@ -2,7 +2,7 @@
 . flags 0 type 131078 SOA(822) submitted
 . flags 1 type 131078 SOA(822) submitted
 . flags 0 type SOA(822): OK; nrrs=1; cname=$; owner=$; ttl=60222
- "A.ROOT-SERVERS.NET" "hostmaster@INTERNIC.NET" 1999041600 1800 900 604800 86400
+ A.ROOT-SERVERS.NET hostmaster@INTERNIC.NET 1999041600 1800 900 604800 86400
 . flags 1 type SOA(822): OK; nrrs=1; cname=$; owner=$; ttl=57210
- "A.ROOT-SERVERS.NET" "hostmaster@INTERNIC.NET" 1999041600 1800 900 604800 86400
+ A.ROOT-SERVERS.NET hostmaster@INTERNIC.NET 1999041600 1800 900 604800 86400
 rc=0
Index: adns/regress/case-rootqueryall-as.out
diff -u adns/regress/case-rootqueryall-as.out:1.1 adns/regress/case-rootqueryall-as.out:1.4
--- adns/regress/case-rootqueryall-as.out:1.1	Wed Jul 14 23:45:05 1999
+++ adns/regress/case-rootqueryall-as.out	Wed Oct 13 01:27:05 1999
@@ -31,21 +31,21 @@
 . flags 1 type 131089 RP(822) submitted
 . flags 0 type A(-): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 0 type NS(raw): OK; nrrs=13; cname=$; owner=$; ttl=518399
- "E.ROOT-SERVERS.NET"
- "I.ROOT-SERVERS.NET"
- "F.ROOT-SERVERS.NET"
- "G.ROOT-SERVERS.NET"
- "J.ROOT-SERVERS.NET"
- "K.ROOT-SERVERS.NET"
- "L.ROOT-SERVERS.NET"
- "M.ROOT-SERVERS.NET"
- "A.ROOT-SERVERS.NET"
- "H.ROOT-SERVERS.NET"
- "B.ROOT-SERVERS.NET"
- "C.ROOT-SERVERS.NET"
- "D.ROOT-SERVERS.NET"
+ E.ROOT-SERVERS.NET
+ I.ROOT-SERVERS.NET
+ F.ROOT-SERVERS.NET
+ G.ROOT-SERVERS.NET
+ J.ROOT-SERVERS.NET
+ K.ROOT-SERVERS.NET
+ L.ROOT-SERVERS.NET
+ M.ROOT-SERVERS.NET
+ A.ROOT-SERVERS.NET
+ H.ROOT-SERVERS.NET
+ B.ROOT-SERVERS.NET
+ C.ROOT-SERVERS.NET
+ D.ROOT-SERVERS.NET
 . flags 0 type SOA(raw): OK; nrrs=1; cname=$; owner=$; ttl=82079
- "A.ROOT-SERVERS.NET" "hostmaster.INTERNIC.NET" 1999071300 1800 900 604800 86400
+ A.ROOT-SERVERS.NET hostmaster.INTERNIC.NET 1999071300 1800 900 604800 86400
 . flags 0 type PTR(raw): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 0 type HINFO(-): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 0 type MX(raw): No such data; nrrs=0; cname=$; owner=$; ttl=599
@@ -53,41 +53,41 @@
 . flags 0 type RP(raw): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 0 type A(addr): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 0 type NS(+addr): OK; nrrs=13; cname=$; owner=$; ttl=518399
- "I.ROOT-SERVERS.NET": AF_INET 192.36.148.17
- "F.ROOT-SERVERS.NET": AF_INET 192.5.5.241
- "G.ROOT-SERVERS.NET": AF_INET 192.112.36.4
- "J.ROOT-SERVERS.NET": AF_INET 198.41.0.10
- "K.ROOT-SERVERS.NET": AF_INET 193.0.14.129
- "L.ROOT-SERVERS.NET": AF_INET 198.32.64.12
- "M.ROOT-SERVERS.NET": AF_INET 202.12.27.33
- "A.ROOT-SERVERS.NET": AF_INET 198.41.0.4
- "H.ROOT-SERVERS.NET": AF_INET 128.63.2.53
- "B.ROOT-SERVERS.NET": AF_INET 128.9.0.107
- "C.ROOT-SERVERS.NET": AF_INET 192.33.4.12
- "D.ROOT-SERVERS.NET": AF_INET 128.8.10.90
- "E.ROOT-SERVERS.NET": AF_INET 192.203.230.10
+ I.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.36.148.17 )
+ F.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.5.5.241 )
+ G.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.112.36.4 )
+ J.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.41.0.10 )
+ K.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 193.0.14.129 )
+ L.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.32.64.12 )
+ M.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 202.12.27.33 )
+ A.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.41.0.4 )
+ H.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.63.2.53 )
+ B.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.9.0.107 )
+ C.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.33.4.12 )
+ D.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.8.10.90 )
+ E.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.203.230.10 )
 . flags 0 type PTR(checked): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 0 type MX(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 0 type SOA(822): OK; nrrs=1; cname=$; owner=$; ttl=77975
- "A.ROOT-SERVERS.NET" "hostmaster@INTERNIC.NET" 1999071300 1800 900 604800 86400
+ A.ROOT-SERVERS.NET hostmaster@INTERNIC.NET 1999071300 1800 900 604800 86400
 . flags 0 type RP(822): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 1 type A(-): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 1 type NS(raw): OK; nrrs=13; cname=$; owner=$; ttl=518399
- "F.ROOT-SERVERS.NET"
- "G.ROOT-SERVERS.NET"
- "J.ROOT-SERVERS.NET"
- "K.ROOT-SERVERS.NET"
- "L.ROOT-SERVERS.NET"
- "M.ROOT-SERVERS.NET"
- "A.ROOT-SERVERS.NET"
- "H.ROOT-SERVERS.NET"
- "B.ROOT-SERVERS.NET"
- "C.ROOT-SERVERS.NET"
- "D.ROOT-SERVERS.NET"
- "E.ROOT-SERVERS.NET"
- "I.ROOT-SERVERS.NET"
+ F.ROOT-SERVERS.NET
+ G.ROOT-SERVERS.NET
+ J.ROOT-SERVERS.NET
+ K.ROOT-SERVERS.NET
+ L.ROOT-SERVERS.NET
+ M.ROOT-SERVERS.NET
+ A.ROOT-SERVERS.NET
+ H.ROOT-SERVERS.NET
+ B.ROOT-SERVERS.NET
+ C.ROOT-SERVERS.NET
+ D.ROOT-SERVERS.NET
+ E.ROOT-SERVERS.NET
+ I.ROOT-SERVERS.NET
 . flags 1 type SOA(raw): OK; nrrs=1; cname=$; owner=$; ttl=74076
- "A.ROOT-SERVERS.NET" "hostmaster.INTERNIC.NET" 1999071300 1800 900 604800 86400
+ A.ROOT-SERVERS.NET hostmaster.INTERNIC.NET 1999071300 1800 900 604800 86400
 . flags 1 type PTR(raw): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 1 type HINFO(-): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 1 type MX(raw): No such data; nrrs=0; cname=$; owner=$; ttl=599
@@ -95,23 +95,23 @@
 . flags 1 type RP(raw): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 1 type A(addr): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 1 type NS(+addr): OK; nrrs=13; cname=$; owner=$; ttl=518399
- "G.ROOT-SERVERS.NET": AF_INET 192.112.36.4
- "J.ROOT-SERVERS.NET": AF_INET 198.41.0.10
- "K.ROOT-SERVERS.NET": AF_INET 193.0.14.129
- "L.ROOT-SERVERS.NET": AF_INET 198.32.64.12
- "M.ROOT-SERVERS.NET": AF_INET 202.12.27.33
- "A.ROOT-SERVERS.NET": AF_INET 198.41.0.4
- "H.ROOT-SERVERS.NET": AF_INET 128.63.2.53
- "B.ROOT-SERVERS.NET": AF_INET 128.9.0.107
- "C.ROOT-SERVERS.NET": AF_INET 192.33.4.12
- "D.ROOT-SERVERS.NET": AF_INET 128.8.10.90
- "E.ROOT-SERVERS.NET": AF_INET 192.203.230.10
- "I.ROOT-SERVERS.NET": AF_INET 192.36.148.17
- "F.ROOT-SERVERS.NET": AF_INET 192.5.5.241
+ G.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.112.36.4 )
+ J.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.41.0.10 )
+ K.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 193.0.14.129 )
+ L.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.32.64.12 )
+ M.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 202.12.27.33 )
+ A.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.41.0.4 )
+ H.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.63.2.53 )
+ B.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.9.0.107 )
+ C.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.33.4.12 )
+ D.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.8.10.90 )
+ E.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.203.230.10 )
+ I.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.36.148.17 )
+ F.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.5.5.241 )
 . flags 1 type PTR(checked): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 1 type MX(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 1 type SOA(822): OK; nrrs=1; cname=$; owner=$; ttl=70372
- "A.ROOT-SERVERS.NET" "hostmaster@INTERNIC.NET" 1999071300 1800 900 604800 86400
+ A.ROOT-SERVERS.NET hostmaster@INTERNIC.NET 1999071300 1800 900 604800 86400
 . flags 1 type RP(822): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 0 type CNAME(-): No such data; nrrs=0; cname=$; owner=$; ttl=86400
 . flags 1 type CNAME(-): No such data; nrrs=0; cname=$; owner=$; ttl=86400
Index: adns/regress/case-rootqueryall.out
diff -u adns/regress/case-rootqueryall.out:1.3 adns/regress/case-rootqueryall.out:1.6
--- adns/regress/case-rootqueryall.out:1.3	Thu Jun 17 01:54:04 1999
+++ adns/regress/case-rootqueryall.out	Wed Oct 13 01:27:05 1999
@@ -31,22 +31,22 @@
 . flags 1 type 131089 RP(822) submitted
 . flags 0 type A(-): No such data; nrrs=0; cname=$; owner=$; ttl=86400
 . flags 0 type NS(raw): OK; nrrs=13; cname=$; owner=$; ttl=305624
- "E.ROOT-SERVERS.NET"
- "I.ROOT-SERVERS.NET"
- "F.ROOT-SERVERS.NET"
- "G.ROOT-SERVERS.NET"
- "J.ROOT-SERVERS.NET"
- "K.ROOT-SERVERS.NET"
- "L.ROOT-SERVERS.NET"
- "M.ROOT-SERVERS.NET"
- "A.ROOT-SERVERS.NET"
- "H.ROOT-SERVERS.NET"
- "B.ROOT-SERVERS.NET"
- "C.ROOT-SERVERS.NET"
- "D.ROOT-SERVERS.NET"
+ E.ROOT-SERVERS.NET
+ I.ROOT-SERVERS.NET
+ F.ROOT-SERVERS.NET
+ G.ROOT-SERVERS.NET
+ J.ROOT-SERVERS.NET
+ K.ROOT-SERVERS.NET
+ L.ROOT-SERVERS.NET
+ M.ROOT-SERVERS.NET
+ A.ROOT-SERVERS.NET
+ H.ROOT-SERVERS.NET
+ B.ROOT-SERVERS.NET
+ C.ROOT-SERVERS.NET
+ D.ROOT-SERVERS.NET
 . flags 0 type CNAME(-): No such data; nrrs=0; cname=$; owner=$; ttl=86400
 . flags 0 type SOA(raw): OK; nrrs=1; cname=$; owner=$; ttl=54334
- "A.ROOT-SERVERS.NET" "hostmaster.INTERNIC.NET" 1999041600 1800 900 604800 86400
+ A.ROOT-SERVERS.NET hostmaster.INTERNIC.NET 1999041600 1800 900 604800 86400
 . flags 0 type PTR(raw): No such data; nrrs=0; cname=$; owner=$; ttl=599
 adns debug: reply not found, id 3123, query owner  (NS=172.18.45.6)
 . flags 0 type HINFO(-): No such data; nrrs=0; cname=$; owner=$; ttl=86400
@@ -58,42 +58,42 @@
 . flags 0 type RP(raw): No such data; nrrs=0; cname=$; owner=$; ttl=86400
 . flags 0 type A(addr): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 0 type NS(+addr): OK; nrrs=13; cname=$; owner=$; ttl=305624
- "I.ROOT-SERVERS.NET": AF_INET 192.36.148.17
- "F.ROOT-SERVERS.NET": AF_INET 192.5.5.241
- "G.ROOT-SERVERS.NET": AF_INET 192.112.36.4
- "J.ROOT-SERVERS.NET": AF_INET 198.41.0.10
- "K.ROOT-SERVERS.NET": AF_INET 193.0.14.129
- "L.ROOT-SERVERS.NET": AF_INET 198.32.64.12
- "M.ROOT-SERVERS.NET": AF_INET 202.12.27.33
- "A.ROOT-SERVERS.NET": AF_INET 198.41.0.4
- "H.ROOT-SERVERS.NET": AF_INET 128.63.2.53
- "B.ROOT-SERVERS.NET": AF_INET 128.9.0.107
- "C.ROOT-SERVERS.NET": AF_INET 192.33.4.12
- "D.ROOT-SERVERS.NET": AF_INET 128.8.10.90
- "E.ROOT-SERVERS.NET": AF_INET 192.203.230.10
+ I.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.36.148.17 )
+ F.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.5.5.241 )
+ G.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.112.36.4 )
+ J.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.41.0.10 )
+ K.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 193.0.14.129 )
+ L.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.32.64.12 )
+ M.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 202.12.27.33 )
+ A.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.41.0.4 )
+ H.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.63.2.53 )
+ B.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.9.0.107 )
+ C.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.33.4.12 )
+ D.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.8.10.90 )
+ E.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.203.230.10 )
 . flags 0 type PTR(checked): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 0 type MX(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=86400
 . flags 0 type SOA(822): OK; nrrs=1; cname=$; owner=$; ttl=51616
- "A.ROOT-SERVERS.NET" "hostmaster@INTERNIC.NET" 1999041600 1800 900 604800 86400
+ A.ROOT-SERVERS.NET hostmaster@INTERNIC.NET 1999041600 1800 900 604800 86400
 . flags 0 type RP(822): No such data; nrrs=0; cname=$; owner=$; ttl=86400
 . flags 1 type A(-): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 1 type NS(raw): OK; nrrs=13; cname=$; owner=$; ttl=305624
- "F.ROOT-SERVERS.NET"
- "G.ROOT-SERVERS.NET"
- "J.ROOT-SERVERS.NET"
- "K.ROOT-SERVERS.NET"
- "L.ROOT-SERVERS.NET"
- "M.ROOT-SERVERS.NET"
- "A.ROOT-SERVERS.NET"
- "H.ROOT-SERVERS.NET"
- "B.ROOT-SERVERS.NET"
- "C.ROOT-SERVERS.NET"
- "D.ROOT-SERVERS.NET"
- "E.ROOT-SERVERS.NET"
- "I.ROOT-SERVERS.NET"
+ F.ROOT-SERVERS.NET
+ G.ROOT-SERVERS.NET
+ J.ROOT-SERVERS.NET
+ K.ROOT-SERVERS.NET
+ L.ROOT-SERVERS.NET
+ M.ROOT-SERVERS.NET
+ A.ROOT-SERVERS.NET
+ H.ROOT-SERVERS.NET
+ B.ROOT-SERVERS.NET
+ C.ROOT-SERVERS.NET
+ D.ROOT-SERVERS.NET
+ E.ROOT-SERVERS.NET
+ I.ROOT-SERVERS.NET
 . flags 1 type CNAME(-): No such data; nrrs=0; cname=$; owner=$; ttl=86400
 . flags 1 type SOA(raw): OK; nrrs=1; cname=$; owner=$; ttl=49034
- "A.ROOT-SERVERS.NET" "hostmaster.INTERNIC.NET" 1999041600 1800 900 604800 86400
+ A.ROOT-SERVERS.NET hostmaster.INTERNIC.NET 1999041600 1800 900 604800 86400
 . flags 1 type PTR(raw): No such data; nrrs=0; cname=$; owner=$; ttl=599
 . flags 1 type HINFO(-): No such data; nrrs=0; cname=$; owner=$; ttl=599
 adns debug: reply not found, id 3132, query owner  (NS=172.18.45.6)
@@ -106,22 +106,22 @@
 . flags 1 type RP(raw): No such data; nrrs=0; cname=$; owner=$; ttl=86399
 . flags 1 type A(addr): No such data; nrrs=0; cname=$; owner=$; ttl=598
 . flags 1 type NS(+addr): OK; nrrs=13; cname=$; owner=$; ttl=305623
- "G.ROOT-SERVERS.NET": AF_INET 192.112.36.4
- "J.ROOT-SERVERS.NET": AF_INET 198.41.0.10
- "K.ROOT-SERVERS.NET": AF_INET 193.0.14.129
- "L.ROOT-SERVERS.NET": AF_INET 198.32.64.12
- "M.ROOT-SERVERS.NET": AF_INET 202.12.27.33
- "A.ROOT-SERVERS.NET": AF_INET 198.41.0.4
- "H.ROOT-SERVERS.NET": AF_INET 128.63.2.53
- "B.ROOT-SERVERS.NET": AF_INET 128.9.0.107
- "C.ROOT-SERVERS.NET": AF_INET 192.33.4.12
- "D.ROOT-SERVERS.NET": AF_INET 128.8.10.90
- "E.ROOT-SERVERS.NET": AF_INET 192.203.230.10
- "I.ROOT-SERVERS.NET": AF_INET 192.36.148.17
- "F.ROOT-SERVERS.NET": AF_INET 192.5.5.241
+ G.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.112.36.4 )
+ J.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.41.0.10 )
+ K.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 193.0.14.129 )
+ L.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.32.64.12 )
+ M.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 202.12.27.33 )
+ A.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 198.41.0.4 )
+ H.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.63.2.53 )
+ B.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.9.0.107 )
+ C.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.33.4.12 )
+ D.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 128.8.10.90 )
+ E.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.203.230.10 )
+ I.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.36.148.17 )
+ F.ROOT-SERVERS.NET ok 0 ok "OK" ( INET 192.5.5.241 )
 . flags 1 type PTR(checked): No such data; nrrs=0; cname=$; owner=$; ttl=598
 . flags 1 type MX(+addr): No such data; nrrs=0; cname=$; owner=$; ttl=598
 . flags 1 type SOA(822): OK; nrrs=1; cname=$; owner=$; ttl=46580
- "A.ROOT-SERVERS.NET" "hostmaster@INTERNIC.NET" 1999041600 1800 900 604800 86400
+ A.ROOT-SERVERS.NET hostmaster@INTERNIC.NET 1999041600 1800 900 604800 86400
 . flags 1 type RP(822): No such data; nrrs=0; cname=$; owner=$; ttl=598
 rc=0
Index: adns/regress/case-sillyrp.out
diff -u adns/regress/case-sillyrp.out:1.1 adns/regress/case-sillyrp.out:1.2
--- adns/regress/case-sillyrp.out:1.1	Thu Jun 17 01:54:04 1999
+++ adns/regress/case-sillyrp.out	Sat Aug 14 19:54:33 1999
@@ -8,13 +8,15 @@
 silly-rp-dm.test.iwj.relativity.greenend.org.uk flags 0 type 17 RP(raw) submitted
 silly-rp-dm.test.iwj.relativity.greenend.org.uk flags 0 type 131089 RP(822) submitted
 silly-rp-dm.test.iwj.relativity.greenend.org.uk flags 112 type RP(raw): OK; nrrs=1; cname=$; owner=$; ttl=60
- "i\\..root\\000null.org" ""
+ i\..root\000null.org .
 silly-rp-dm.test.iwj.relativity.greenend.org.uk flags 112 type RP(822): Found syntactically invalid domain name; nrrs=0; cname=$; owner=$; ttl=60
 silly-rp-lp.test.iwj.relativity.greenend.org.uk flags 112 type RP(raw): OK; nrrs=1; cname=$; owner=$; ttl=60
- "spong\\000flibble.ucam.org" ""
+ spong\000flibble.ucam.org .
 silly-rp-lp.test.iwj.relativity.greenend.org.uk flags 112 type RP(822): Found invalid DNS data; nrrs=0; cname=$; owner=$; ttl=60
-silly-rp-lp.test.iwj.relativity.greenend.org.uk flags 0 type RP(raw): Found syntactically invalid domain name; nrrs=0; cname=$; owner=$; ttl=60
+silly-rp-lp.test.iwj.relativity.greenend.org.uk flags 0 type RP(raw): OK; nrrs=1; cname=$; owner=$; ttl=60
+ spong\000flibble.ucam.org .
 silly-rp-lp.test.iwj.relativity.greenend.org.uk flags 0 type RP(822): Found invalid DNS data; nrrs=0; cname=$; owner=$; ttl=60
-silly-rp-dm.test.iwj.relativity.greenend.org.uk flags 0 type RP(raw): Found syntactically invalid domain name; nrrs=0; cname=$; owner=$; ttl=60
+silly-rp-dm.test.iwj.relativity.greenend.org.uk flags 0 type RP(raw): OK; nrrs=1; cname=$; owner=$; ttl=60
+ i\..root\000null.org .
 silly-rp-dm.test.iwj.relativity.greenend.org.uk flags 0 type RP(822): Found syntactically invalid domain name; nrrs=0; cname=$; owner=$; ttl=60
 rc=0
Index: adns/regress/case-tcpmultipart.out
diff -u /dev/null adns/regress/case-tcpmultipart.out:1.1
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/regress/case-tcpmultipart.out	Sun Sep 26 19:21:07 1999
@@ -0,0 +1,71 @@
+adns debug: using nameserver 172.31.80.9
+132.76.224.195.in-addr.arpa flags 2 type 12 PTR(raw) submitted
+manymorerrs.test.culture.dotat.at. flags 2 type 12 PTR(raw) submitted
+132.76.224.195.in-addr.arpa flags 2 type 12 PTR(raw) submitted
+adns debug: TCP connected (NS=172.31.80.9)
+132.76.224.195.in-addr.arpa flags 2 type PTR(raw): OK; nrrs=1; cname=$; owner=$; ttl=86400
+ chiark.greenend.org.uk
+manymorerrs.test.culture.dotat.at. flags 2 type PTR(raw): OK; nrrs=60; cname=$; owner=$; ttl=86400
+ very-long-domain.to-ensure-truncation.00.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.01.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.02.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.03.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.04.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.05.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.06.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.07.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.08.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.09.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.10.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.11.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.12.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.13.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.14.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.15.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.16.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.17.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.18.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.19.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.20.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.21.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.22.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.23.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.24.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.25.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.26.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.27.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.28.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.29.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.30.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.31.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.32.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.33.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.34.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.35.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.36.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.37.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.38.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.39.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.40.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.41.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.42.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.43.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.44.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.45.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.46.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.47.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.48.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.49.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.50.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.51.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.52.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.53.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.54.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.55.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.56.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.57.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.58.test.culture.dotat.at
+ very-long-domain.to-ensure-truncation.59.test.culture.dotat.at
+132.76.224.195.in-addr.arpa flags 2 type PTR(raw): OK; nrrs=1; cname=$; owner=$; ttl=86400
+ chiark.greenend.org.uk
+rc=0
Index: adns/regress/case-tcpmultipart.sys
diff -u /dev/null adns/regress/case-tcpmultipart.sys:1.1
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/regress/case-tcpmultipart.sys	Sun Sep 26 19:21:07 1999
@@ -0,0 +1,248 @@
+tunnel
+:12 2/132.76.224.195.in-addr.arpa 2/manymorerrs.test.culture.dotat.at. 2/132.76.224.195.in-addr.arpa
+ start 938365454.994875
+ socket type=SOCK_DGRAM
+ socket=4
+ +0.000164
+ fcntl fd=4 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000055
+ fcntl fd=4 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000043
+ socket type=SOCK_STREAM
+ socket=5
+ +0.001177
+ fcntl fd=5 cmd=F_GETFL
+ fcntl=~O_NONBLOCK&...
+ +0.000044
+ fcntl fd=5 cmd=F_SETFL O_NONBLOCK|...
+ fcntl=OK
+ +0.000041
+ connect fd=5 addr=172.31.80.9:53
+ connect=EINPROGRESS
+ +0.000414
+ select max=6 rfds=[4] wfds=[5] efds=[] to=29.998324
+ select=1 rfds=[] wfds=[5] efds=[]
+ +1.-647444
+ read fd=5 buflen=1
+ read=EAGAIN
+ +0.000176
+ write fd=5
+     002d311f 01000001 00000000 00000331 33320237 36033232 34033139 3507696e
+     2d616464 72046172 70610000 0c0001.
+ write=47
+ +0.000727
+ write fd=5
+     00333120 01000001 00000000 00000b6d 616e796d 6f726572 72730474 65737407
+     63756c74 75726505 646f7461 74026174 00000c00 01.
+ write=53
+ +0.000359
+ write fd=5
+     002d3121 01000001 00000000 00000331 33320237 36033232 34033139 3507696e
+     2d616464 72046172 70610000 0c0001.
+ write=47
+ +0.000273
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=29.998465
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.538651
+ read fd=5 buflen=2
+ read=OK
+     0127.
+ +0.000289
+ read fd=5 buflen=295
+ read=OK
+     311f8580 00010001 00050005 03313332 02373603 32323403 31393507 696e2d61
+     64647204 61727061 00000c00 01c00c00 0c000100 01518000 18066368 6961726b
+     08677265 656e656e 64036f72 6702756b 00023736 03323234 03313935 07696e2d
+     61646472 04617270 61000002 00010001 51800011 04646e73 3006656c 6d61696c
+     02636fc0 4dc05100 02000100 01518000 0704646e 7331c079 c0510002 00010001
+     51800007 04646e73 32c079c0 51000200 01000151 80000e03 6e733204 78617261
+     036e6574 00c05100 02000100 01518000 06036e73 33c0bbc0 74000100 01000055
+     c80004c1 7ae911c0 91000100 0100004f 650004c1 7ae901c0 a4000100 0100004f
+     650004c3 e04cc1c0 b7000100 0100014c 4b0004c2 8fa16bc0 d1000100 0100014c
+     4b0004c2 8fa319.
+ +0.001247
+ read fd=5 buflen=297
+ read=EAGAIN
+ +0.000476
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=29.457802
+ select=1 rfds=[5] wfds=[] efds=[]
+ +1.-401146
+ read fd=5 buflen=297
+ read=OK
+     0dbe3120 85800001 003c0002 00020b6d 616e796d 6f726572 72730474 65737407
+     63756c74 75726505 646f7461 74026174 00000c00 01c00c00 0c000100 01518000
+     40107665 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265 2d747275
+     6e636174 696f6e02 30300474 65737407 63756c74 75726505 646f7461 74026174
+     00c00c00 0c000100 01518000 2b107665 72792d6c 6f6e672d 646f6d61 696e1474
+     6f2d656e 73757265 2d747275 6e636174 696f6e02 3031c068 c00c000c 00010001
+     5180002b 10766572 792d6c6f 6e672d64 6f6d6169 6e14746f 2d656e73 7572652d
+     7472756e 63617469 6f6e0230 32c068c0 0c000c00 01000151 80002b10 76657279
+     2d6c6f6e 672d646f 6d61696e 14746f2d 656e7375 72652d74 72756e63 6174696f
+     6e023033 c068c00c 00.
+ +0.001076
+ read fd=5 buflen=3223
+ read=OK
+     0c000100 01518000 2b107665 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e
+     73757265 2d747275 6e636174 696f6e02 3034c068 c00c000c 00010001 5180002b
+     10766572 792d6c6f 6e672d64 6f6d6169 6e14746f 2d656e73 7572652d 7472756e
+     63617469 6f6e0230 35c068c0 0c000c00 01000151 80002b10 76657279 2d6c6f6e
+     672d646f 6d61696e 14746f2d 656e7375 72652d74 72756e63 6174696f 6e023036
+     c068c00c 000c0001 00015180 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14
+     746f2d65 6e737572 652d7472 756e6361 74696f6e 023037c0 68c00c00 0c000100
+     01518000 2b107665 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265
+     2d747275 6e636174 696f6e02 3038c068 c00c000c 00010001 5180002b 10766572
+     792d6c6f 6e672d64 6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469
+     6f6e0230 39c068c0 0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f
+     6d61696e 14746f2d 656e7375 72652d74 72756e63 6174696f 6e023130 c068c00c
+     000c0001 00015180 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65
+     6e737572 652d7472 756e6361 74696f6e 023131c0 68c00c00 0c000100 01518000
+     2b107665 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265 2d747275
+     6e636174 696f6e02 3132c068 c00c000c 00010001 5180002b 10766572 792d6c6f
+     6e672d64 6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469 6f6e0231
+     33c068c0 0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f 6d61696e
+     14746f2d 656e7375 72652d74 72756e63 6174696f 6e023134 c068c00c 000c0001
+     00015180 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65 6e737572
+     652d7472 756e6361 74696f.
+ +0.002411
+ read fd=5 buflen=2572
+ read=EAGAIN
+ +0.000101
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=28.855360
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.336462
+ read fd=5 buflen=2572
+ read=OK
+     6e023135 c068c00c 000c0001 00015180 002b1076 6572792d 6c6f6e67 2d646f6d
+     61696e14 746f2d65 6e737572 652d7472 756e6361 74696f6e 023136c0 68c00c00
+     0c000100 01518000 2b107665 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e
+     73757265 2d747275 6e636174 696f6e02 3137c068 c00c000c 00010001 5180002b
+     10766572 792d6c6f 6e672d64 6f6d6169 6e14746f 2d656e73 7572652d 7472756e
+     63617469 6f6e0231 38c068c0 0c000c00 01000151 80002b10 76657279 2d6c6f6e
+     672d646f 6d61696e 14746f2d 656e7375 72652d74 72756e63 6174696f 6e023139
+     c068c00c 000c0001 00015180 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14
+     746f2d65 6e737572 652d7472 756e6361 74696f6e 023230c0 68c00c00 0c000100
+     01518000 2b107665 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265
+     2d747275 6e636174 696f6e02 3231c068 c00c000c 00010001 5180002b 10766572
+     792d6c6f 6e672d64 6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469
+     6f6e0232 32c068c0 0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f
+     6d61696e 14746f2d 656e7375 72652d74 72756e63 6174696f 6e023233 c068c00c
+     000c0001 00015180 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65
+     6e737572 652d7472 756e6361 74696f6e 023234c0 68c00c00 0c000100 01518000
+     2b107665 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265 2d747275
+     6e636174 696f6e02 3235c068 c00c000c 00010001 5180002b 10766572 792d6c6f
+     6e672d64 6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469 6f6e0232
+     36c068c0 0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f 6d61696e
+     14746f2d 656e7375 72652d74 72756e63 6174696f 6e023237 c068c00c 000c0001
+     00015180 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65 6e737572
+     652d7472 756e6361 74696f6e 023238c0 68c00c00 0c000100 01518000 2b107665
+     72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265 2d747275 6e636174
+     696f6e02 3239c068 c00c000c 00010001 5180002b 10766572 792d6c6f 6e672d64
+     6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469 6f6e0233 30c068c0
+     0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f 6d61696e 14746f2d
+     656e7375 72652d74 72756e63 6174696f 6e023331 c068c00c 000c0001 00015180
+     002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65 6e737572 652d7472
+     756e6361 74696f6e 023332c0 68c00c00 0c000100.
+ +0.003315
+ read fd=5 buflen=1624
+ read=EAGAIN
+ +0.000124
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=28.515459
+ select=1 rfds=[5] wfds=[] efds=[]
+ +1.-683589
+ read fd=5 buflen=1624
+ read=OK
+     01518000 2b107665 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265
+     2d747275 6e636174 696f6e02 3333c068 c00c000c 00010001 5180002b 10766572
+     792d6c6f 6e672d64 6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469
+     6f6e0233 34c068c0 0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f
+     6d61696e 14746f2d 656e7375 72652d74 72756e63 6174696f 6e023335 c068c00c
+     000c0001 00015180 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65
+     6e737572 652d7472 756e6361 74696f6e 023336c0 68c00c00 0c000100 01518000
+     2b107665 72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265 2d747275
+     6e636174 696f6e02 3337c068 c00c000c 00010001 5180002b 10766572 792d6c6f
+     6e672d64 6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469 6f6e0233
+     38c068c0 0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f 6d61696e
+     14746f2d 656e7375 72652d74 72756e63 6174696f 6e023339 c068c00c 000c0001
+     00015180 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65 6e737572
+     652d7472 756e6361 74696f6e 023430c0 68c00c00 0c000100 01518000 2b107665
+     72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265 2d747275 6e636174
+     696f6e02 3431c068 c00c000c 00010001 5180002b 10766572 792d6c6f 6e672d64
+     6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469 6f6e0234 32c068c0
+     0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f 6d61696e 14746f2d
+     656e7375 72652d74 72756e63 6174696f 6e023433 c068c00c 000c0001 00015180
+     002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65 6e737572 652d7472
+     756e6361 74696f6e 023434c0 68c00c00 0c000100 01518000 2b107665 72792d6c
+     6f6e672d 646f6d61 696e1474 6f2d656e 73757265 2d747275 6e636174 696f6e02
+     3435c068 c00c000c 00010001 5180002b 10766572 792d6c6f 6e672d64 6f6d6169
+     6e14746f 2d656e73 7572652d 7472756e 63617469 6f6e0234 36c068c0 0c000c00
+     01000151 80002b10 76657279 2d6c6f6e 672d646f 6d61696e 14746f2d 656e7375
+     72652d74 72756e63 6174696f 6e023437 c068c00c 000c0001 00015180 002b1076
+     6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65 6e737572 652d7472 756e6361
+     74696f6e 023438c0 68c00c00 0c000100 01518000 2b107665 72792d6c 6f6e672d
+     646f6d61 696e1474 6f2d656e 73757265 2d747275 6e636174 696f6e02 3439c068
+     c00c000c 00010001 5180002b 10766572 792d6c6f.
+ +0.003201
+ read fd=5 buflen=676
+ read=EAGAIN
+ +0.000114
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=28.195733
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.376863
+ read fd=5 buflen=676
+ read=OK
+     6e672d64 6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469 6f6e0235
+     30c068c0 0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f 6d61696e
+     14746f2d 656e7375 72652d74 72756e63 6174696f 6e023531 c068c00c 000c0001
+     00015180 002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65 6e737572
+     652d7472 756e6361 74696f6e 023532c0 68c00c00 0c000100 01518000 2b107665
+     72792d6c 6f6e672d 646f6d61 696e1474 6f2d656e 73757265 2d747275 6e636174
+     696f6e02 3533c068 c00c000c 00010001 5180002b 10766572 792d6c6f 6e672d64
+     6f6d6169 6e14746f 2d656e73 7572652d 7472756e 63617469 6f6e0235 34c068c0
+     0c000c00 01000151 80002b10 76657279 2d6c6f6e 672d646f 6d61696e 14746f2d
+     656e7375 72652d74 72756e63 6174696f 6e023535 c068c00c 000c0001 00015180
+     002b1076 6572792d 6c6f6e67 2d646f6d 61696e14 746f2d65 6e737572 652d7472
+     756e6361 74696f6e 023536c0 68c00c00 0c000100 01518000 2b107665 72792d6c
+     6f6e672d 646f6d61 696e1474 6f2d656e 73757265 2d747275 6e636174 696f6e02
+     3537c068 c00c000c 00010001 5180002b 10766572 792d6c6f 6e672d64 6f6d6169
+     6e14746f 2d656e73 7572652d 7472756e 63617469 6f6e0235 38c068c0 0c000c00
+     01000151 80002b10 76657279 2d6c6f6e 672d646f 6d61696e 14746f2d 656e7375
+     72652d74 72756e63 6174696f 6e023539 c068c06d 00020001 00054600 0014076c
+     69627261 7279066c 73706163 65036f72 6700c06d 00020001 00054600 001b026e
+     73066368 6961726b 08677265 656e656e 64036f72 6702756b 00076c69 62726172
+     79066c73 70616365 036f7267 00000100 01000161 890004c3 c8013a02 6e730663
+     68696172 6b086772 65656e65 6e64036f 72670275 6b000001 00010001 51800004
+     c3e04c84.
+ +0.002355
+ read fd=5 buflen=3520
+ read=OK
+     01273121 85800001 00010005 00050331 33320237 36033232 34033139 3507696e
+     2d616464 72046172 70610000 0c0001c0 0c000c00 01000151 80001806 63686961
+     726b0867 7265656e 656e6403 6f726702 756b0002 37360332 32340331 39350769
+     6e2d6164 64720461 72706100 00020001 00015180 00110464 6e733006 656c6d61
+     696c0263 6fc04dc0 51000200 01000151 80000704 646e7331 c079c051 00020001
+     00015180 00070464 6e7332c0 79c05100 02000100 01518000 0e036e73 32047861
+     7261036e 657400c0 51000200 01000151 80000603 6e7333c0 bbc07400 01000100
+     0055c800 04c17ae9 11c09100 01000100 004f6500 04c17ae9 01c0a400 01000100
+     004f6500 04c3e04c c1c0b700 01000100.
+ +0.009447
+ read fd=5 buflen=3248
+ read=EAGAIN
+ +0.000066
+ select max=6 rfds=[4,5] wfds=[] efds=[5] to=27.807002
+ select=1 rfds=[5] wfds=[] efds=[]
+ +0.316770
+ read fd=5 buflen=3248
+ read=OK
+     014c4b00 04c28fa1 6bc0d100 01000100 014c4b00 04c28fa3 19.
+ +0.000195
+ read fd=5 buflen=3520
+ read=EAGAIN
+ +0.000429
+ close fd=4
+ close=OK
+ +0.000375
+ close fd=5
+ close=OK
+ +0.000226
Index: adns/regress/checkall
diff -u adns/regress/checkall:1.3 adns/regress/checkall:1.4
--- adns/regress/checkall:1.3	Sun Jul 11 19:15:16 1999
+++ adns/regress/checkall	Sun Aug 15 16:09:28 1999
@@ -1,31 +1,46 @@
 #!/bin/sh
 
+set -e
+
 failed=''
 passed=''
+skipped=''
 
 for f in case-*.sys
 do
 	case="`echo \"$f\" | sed -e 's/^case-//; s/\.sys$//'`"
-	if ./r1test $case
-	then
-		passed="$passed $case"
-	else
-		echo
+	set +e
+	./r1test $case
+	rc=$?
+	set -e
+	case $rc in
+	0)	passed="$passed $case" ;;
+	5)	skipped="$skipped $case" ;;
+	*)	echo
 		failed="$failed $case"
 		echo
-	fi
+		;;
+	esac
 done
 
 if [ "x$failed" = x ]
 then
 	echo "
-all tests passed."
+"
+	if [ "x$skipped" = x ]
+	then
+		echo "all tests passed."
+	else
+		echo "all applicable tests passed (skipped:$skipped)"
+	fi
+	echo
 	exit 0
 fi
 
 echo >&2 "
 AT LEAST ONE TEST FAILED
 passed tests:${passed:- NONE}
+skipped tests:${skipped:- NONE}
 failed tests:$failed
 "
 
Index: adns/regress/harness.h.m4
diff -u adns/regress/harness.h.m4:1.6 adns/regress/harness.h.m4:1.7
--- adns/regress/harness.h.m4:1.6	Thu Aug  5 01:03:24 1999
+++ adns/regress/harness.h.m4	Sun Oct 10 14:16:24 1999
@@ -2,7 +2,12 @@
 m4_dnl (part of complex test harness, not of the library)
 m4_dnl - function and other declarations
 
-m4_dnl  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+m4_dnl  This file is
+m4_dnl    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl
+m4_dnl  It is part of adns, which is
+m4_dnl    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl    Copyright (C) 1999 Tony Finch <dot@dotat.at>
 m4_dnl  
 m4_dnl  This program is free software; you can redistribute it and/or modify
 m4_dnl  it under the terms of the GNU General Public License as published by
Index: adns/regress/hcommon.c.m4
diff -u adns/regress/hcommon.c.m4:1.6 adns/regress/hcommon.c.m4:1.9
--- adns/regress/hcommon.c.m4:1.6	Sun Jul 11 20:11:06 1999
+++ adns/regress/hcommon.c.m4	Tue Oct 12 22:29:02 1999
@@ -2,7 +2,12 @@
 m4_dnl (part of complex test harness, not of the library)
 m4_dnl - routines used for both record and playback
 
-m4_dnl  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+m4_dnl  This file is
+m4_dnl    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl
+m4_dnl  It is part of adns, which is
+m4_dnl    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl    Copyright (C) 1999 Tony Finch <dot@dotat.at>
 m4_dnl  
 m4_dnl  This program is free software; you can redistribute it and/or modify
 m4_dnl  it under the terms of the GNU General Public License as published by
@@ -177,8 +182,8 @@
   const struct Terrno *te;
 
   for (te= Terrnos; te->n && te->v != e; te++);
-  if (te->n) Tvba(te->n);
-  else Tvbf("E#%d",e);
+  assert(te->n);
+  Tvba(te->n);
 }
 
 void Tvba(const char *str) {
Index: adns/regress/hmacros.i4
diff -u adns/regress/hmacros.i4:1.5 adns/regress/hmacros.i4:1.6
--- adns/regress/hmacros.i4:1.5	Sun Jul 11 20:11:06 1999
+++ adns/regress/hmacros.i4	Sun Oct 10 14:16:24 1999
@@ -2,7 +2,12 @@
 m4_dnl (part of complex test harness, not of the library)
 m4_dnl - common macros
 
-m4_dnl  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+m4_dnl  This file is
+m4_dnl    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl
+m4_dnl  It is part of adns, which is
+m4_dnl    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl    Copyright (C) 1999 Tony Finch <dot@dotat.at>
 m4_dnl  
 m4_dnl  This program is free software; you can redistribute it and/or modify
 m4_dnl  it under the terms of the GNU General Public License as published by
Index: adns/regress/hplayback.c.m4
diff -u adns/regress/hplayback.c.m4:1.7 adns/regress/hplayback.c.m4:1.9
--- adns/regress/hplayback.c.m4:1.7	Thu Aug  5 01:03:24 1999
+++ adns/regress/hplayback.c.m4	Tue Oct 12 22:28:29 1999
@@ -2,7 +2,12 @@
 m4_dnl (part of complex test harness, not of the library)
 m4_dnl - playback routines
 
-m4_dnl  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+m4_dnl  This file is
+m4_dnl    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl
+m4_dnl  It is part of adns, which is
+m4_dnl    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl    Copyright (C) 1999 Tony Finch <dot@dotat.at>
 m4_dnl  
 m4_dnl  This program is free software; you can redistribute it and/or modify
 m4_dnl  it under the terms of the GNU General Public License as published by
@@ -110,8 +115,8 @@
 
   for (te= Terrnos; te->n && strcmp(te->n,stuff); te++);
   if (te->n) return te->v;
-  r= strtoul(stuff+1,&ep,10);
-  if (ep) Psyntax("errno value not recognised, not numeric");
+  r= strtoul(stuff+2,&ep,10);
+  if (*ep) Psyntax("errno value not recognised, not numeric");
   return r;
 }
 
Index: adns/regress/hrecord.c.m4
diff -u adns/regress/hrecord.c.m4:1.9 adns/regress/hrecord.c.m4:1.10
--- adns/regress/hrecord.c.m4:1.9	Sun Jul 11 20:11:07 1999
+++ adns/regress/hrecord.c.m4	Sun Oct 10 14:16:24 1999
@@ -2,7 +2,12 @@
 m4_dnl (part of complex test harness, not of the library)
 m4_dnl - recording routines
 
-m4_dnl  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+m4_dnl  This file is
+m4_dnl    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl
+m4_dnl  It is part of adns, which is
+m4_dnl    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl    Copyright (C) 1999 Tony Finch <dot@dotat.at>
 m4_dnl  
 m4_dnl  This program is free software; you can redistribute it and/or modify
 m4_dnl  it under the terms of the GNU General Public License as published by
Index: adns/regress/hsyscalls.i4
diff -u adns/regress/hsyscalls.i4:1.6 adns/regress/hsyscalls.i4:1.7
--- adns/regress/hsyscalls.i4:1.6	Thu Aug  5 01:03:24 1999
+++ adns/regress/hsyscalls.i4	Sun Oct 10 14:16:24 1999
@@ -2,7 +2,12 @@
 m4_dnl (part of complex test harness, not of the library)
 m4_dnl - list of syscalls to override/log and their args
 
-m4_dnl  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+m4_dnl  This file is
+m4_dnl    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl
+m4_dnl  It is part of adns, which is
+m4_dnl    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+m4_dnl    Copyright (C) 1999 Tony Finch <dot@dotat.at>
 m4_dnl  
 m4_dnl  This program is free software; you can redistribute it and/or modify
 m4_dnl  it under the terms of the GNU General Public License as published by
Index: adns/regress/init-tunnel.text
diff -u /dev/null adns/regress/init-tunnel.text:1.1
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/regress/init-tunnel.text	Sun Sep 26 19:21:11 1999
@@ -0,0 +1,3 @@
+nameserver 172.31.80.9
+sortlist 127.0.0.1/32 172.18.45.0/24 172.31.80.0/28
+search davenant.greenend.org.uk greenend.org.uk
Index: adns/regress/m1test
diff -u adns/regress/m1test:1.6 adns/regress/m1test:1.7
--- adns/regress/m1test:1.6	Sun Jul 11 20:11:08 1999
+++ adns/regress/m1test	Wed Oct 13 01:27:41 1999
@@ -22,6 +22,9 @@
 echo $initfile $initflags >"$case.sys"
 echo "$queryargs" >>"$case.sys"
 
+EF_DISABLE_BANNER=1
+export EF_DISABLE_BANNER
+
 echo running hrecord $initflags "/... $queryargs"
 set +e
 ADNS_TEST_OUT_FD=3 3>>"$case.sys" >"$case.out" 2>"$case.err" </dev/null \
Index: adns/regress/r1test
diff -u adns/regress/r1test:1.7 adns/regress/r1test:1.9
--- adns/regress/r1test:1.7	Sun Jul 11 20:11:08 1999
+++ adns/regress/r1test	Wed Oct 13 01:27:41 1999
@@ -2,6 +2,9 @@
 # usage: r1test <testcasename>
 
 set -e
+mrc=1
+trap 'exit $mrc' 0
+
 casename="$1"
 case="case-$casename"
 ocase="output-$casename"
@@ -14,12 +17,22 @@
 
 rm -f $ocase.*
 
+EF_DISABLE_BANNER=1
+export EF_DISABLE_BANNER
+
 set +e
 ADNS_TEST_REPORT_FD=3 3>>"$ocase.report" >"$ocase.out" 2>"$ocase.err" \
  ./hplayback $initflags "/$initstring" $queryargs
 rc=$?
 set -e
 
+if [ "$rc" = 5 ]
+then
+	echo -n "SKIPPED-$casename "
+	mrc=5
+	exit
+fi
+
 echo "rc=$rc" >>$ocase.out
 
 failed=false
@@ -36,9 +49,9 @@
 if $failed
 then
 	echo >&2 "FAILED $case - WRONG OUTPUT - lines of syscall remaining `wc -l`"
-	exit 2
+	mrc=2
+	exit
 fi
 
 echo -n "$casename "
-
-exit 0
+mrc=0
Index: adns/src/Makefile.in
diff -u adns/src/Makefile.in:1.19 adns/src/Makefile.in:1.20
--- adns/src/Makefile.in:1.19	Tue Mar 30 19:57:16 1999
+++ adns/src/Makefile.in	Sun Oct 10 14:16:24 1999
@@ -1,6 +1,11 @@
 # src/Makefile - library main Makefile
 # 
-#  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+#  This file is
+#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#
+#  It is part of adns, which is
+#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#    Copyright (C) 1999 Tony Finch <dot@dotat.at>
 #  
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
Index: adns/src/adns.h
diff -u adns/src/adns.h:1.55 adns/src/adns.h:1.70
--- adns/src/adns.h:1.55	Thu Aug  5 01:03:24 1999
+++ adns/src/adns.h	Wed Oct 13 02:23:56 1999
@@ -3,7 +3,13 @@
  * - adns user-visible API (single-threaded, without any locking)
  */
 /*
- *  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+ *
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
  *  
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -14,12 +20,38 @@
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
+ *
+ * 
+ *  For the benefit of certain LGPL'd `omnibus' software which provides
+ *  a uniform interface to various things including adns, I make the
+ *  following additional licence.  I do this because the GPL would
+ *  otherwise force either the omnibus software to be GPL'd or for the
+ *  adns-using part to be distributed separately.
  *  
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software Foundation,
+ *  So, you may also redistribute and/or modify adns.h (but only the
+ *  public header file adns.h and not any other part of adns) under the
+ *  terms of the GNU Library General Public License as published by the
+ *  Free Software Foundation; either version 2 of the License, or (at
+ *  your option) any later version.
+ *  
+ *  Note that adns itself is GPL'd.  Authors of adns-using applications
+ *  with GPL-incompatible licences, and people who distribute adns with
+ *  applications where the whole distribution is not GPL'd, are still
+ *  likely to be in violation of the GPL.  Anyone who wants to do this
+ *  should contact Ian Jackson.  Please note that to avoid encouraging
+ *  people to infringe the GPL as it applies the body of adns, I think
+ *  that if you take advantage of the special exception to redistribute
+ *  just adns.h under the LGPL, you should retain this paragraph in its
+ *  place in the appropriate copyright statements.
+ *
+ *
+ *  You should have received a copy of the GNU General Public License,
+ *  or the GNU Library General Public License, as appropriate, along
+ *  with this program; if not, write to the Free Software Foundation,
  *  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
  *
- *  $Id: adns.h,v 1.55 1999/08/05 00:03:24 ian Exp $
+ *  $Id: adns.h,v 1.70 1999/10/13 01:23:56 ian Exp $
  */
 
 #ifndef ADNS_H_INCLUDED
@@ -49,18 +81,21 @@
   adns_if_noautosys=    0x0010, /* do not make syscalls at every opportunity */
   adns_if_eintr=        0x0020, /* allow _wait and _synchronous to return EINTR */
   adns_if_nosigpipe=    0x0040, /* applic has SIGPIPE set to SIG_IGN, do not protect */
+  adns_if_checkc_entex= 0x0100, /* do consistency checks on entry/exit to adns funcs */
+  adns_if_checkc_freq=  0x0300  /* do consistency checks very frequently (slow!) */
 } adns_initflags;
 
 typedef enum {
-  adns_qf_search=          0x000001, /* use the searchlist */
-  adns_qf_usevc=           0x000002, /* use a virtual circuit (TCP connection) */
-  adns_qf_owner=           0x000004, /* fill in the owner field in the answer */
-  adns_qf_quoteok_query=   0x000010, /* allow quote-requiring chars in query domain */
-  adns_qf_quoteok_cname=   0x000020, /* allow ... in CNAME we go via */
-  adns_qf_quoteok_anshost= 0x000040, /* allow ... in answers expected to be hostnames */
-  adns_qf_cname_loose=     0x000100, /* allow refs to CNAMEs - without, get _s_cname */
-  adns_qf_cname_forbid=    0x000200, /* don't follow CNAMEs, instead give _s_cname */
-  adns__qf_internalmask=   0x0ff000
+  adns_qf_search=          0x00000001, /* use the searchlist */
+  adns_qf_usevc=           0x00000002, /* use a virtual circuit (TCP connection) */
+  adns_qf_owner=           0x00000004, /* fill in the owner field in the answer */
+  adns_qf_quoteok_query=   0x00000010, /* allow quote-requiring chars in query domain */
+  adns_qf_quoteok_cname=   0x00000000, /* allow ... in CNAME we go via - now default */
+  adns_qf_quoteok_anshost= 0x00000040, /* allow ... in things supposed to be hostnames */
+  adns_qf_quotefail_cname= 0x00000080, /* refuse if quote-req chars in CNAME we go via */
+  adns_qf_cname_loose=     0x00000100, /* allow refs to CNAMEs - without, get _s_cname */
+  adns_qf_cname_forbid=    0x00000200, /* don't follow CNAMEs, instead give _s_cname */
+  adns__qf_internalmask=   0x0ff00000
 } adns_queryflags;
 
 typedef enum {
@@ -97,18 +132,57 @@
   
 } adns_rrtype;
 
-/* In queries without qf_quoteok_*, all domains must have standard
- * legal syntax.  In queries _with_ qf_quoteok_*, domains in the query
- * or response may contain any characters, quoted according to RFC1035
- * 5.1.  On input to adns, the char* is a pointer to the interior of a
- * " delimited string, except that " may appear in it, and on output,
+/*
+ * In queries without qf_quoteok_*, all domains must have standard
+ * legal syntax, or you get adns_s_querydomainvalid (if the query
+ * domain contains bad characters) or adns_s_answerdomaininvalid (if
+ * the answer contains bad characters).
+ * 
+ * In queries _with_ qf_quoteok_*, domains in the query or response
+ * may contain any characters, quoted according to RFC1035 5.1.  On
+ * input to adns, the char* is a pointer to the interior of a "
+ * delimited string, except that " may appear in it, and on output,
  * the char* is a pointer to a string which would be legal either
  * inside or outside " delimiters, and any characters not usually
  * legal in domain names will be quoted as \X (if the character is
  * 33-126 except \ and ") or \DDD.
+ *
+ * If the query goes via a CNAME then the canonical name (ie, the
+ * thing that the CNAME record refers to) is usually allowed to
+ * contain any characters, which will be quoted as above.  With
+ * adns_qf_quotefail_cname you get adns_s_answerdomaininvalid when
+ * this happens.  (This is a change from version 0.4 and earlier, in
+ * which failing the query was the default, and you had to say
+ * adns_qf_quoteok_cname to avoid this; that flag is now deprecated.)
+ *
+ * In version 0.4 and earlier, asking for _raw records containing
+ * mailboxes without specifying _qf_quoteok_anshost was silly.  This
+ * is no longer the case.  In this version only parts of responses
+ * that are actually supposed to be hostnames will be refused by
+ * default if quote-requiring characters are found.
+ */
+
+/*
+ * If you ask for an RR which contains domains which are actually
+ * encoded mailboxes, and don't ask for the _raw version, then adns
+ * returns the mailbox formatted suitably for an RFC822 recipient
+ * header field.  The particular format used is that if the mailbox
+ * requires quoting according to the rules in RFC822 then the
+ * local-part is quoted in double quotes, which end at the next
+ * unescaped double quote.  (\ is the escape char, and is doubled, and
+ * is used to escape only \ and ".)  Otherwise the local-part is
+ * presented as-is.  In any case this is followed by an @ and the
+ * domain.  The domain will not contain any characters not legal in
+ * hostnames.  adns will protect the application from local parts
+ * containing control characters - these appear to be legal according
+ * to RFC822 but are clearly a bad idea.
+ *
+ * If you ask for the domain with _raw then _no_ checking is done
+ * (even on the host part, regardless of adns_qf_quoteok_anshost), and
+ * you just get the domain name in master file format.
  *
- * Do not ask for _raw records containing mailboxes without
- * specifying _qf_anyquote.
+ * If no mailbox is supplied the returned string will be `.' in either
+ * caswe.
  */
 
 typedef enum {
@@ -158,6 +232,8 @@
   /* permanent errors */
   adns_s_nxdomain,
   adns_s_nodata,
+
+  adns_s_max_permfail= 499
   
 } adns_status;
 
@@ -210,7 +286,7 @@
   char *owner; /* only set if requested in query flags */
   adns_rrtype type; /* guaranteed to be same as in query */
   time_t expires; /* expiry time, defined only if _s_ok, nxdomain or nodata. NOT TTL! */
-  int nrrs, rrsz;
+  int nrrs, rrsz; /* nrrs is 0 if an error occurs */
   union {
     void *untyped;
     unsigned char *bytes;
@@ -246,9 +322,9 @@
  *  values.
  * 
  *  For _wait and _check failures are reported in the answer
- *  structure, and only 0, ESRCH or (for _check) EWOULDBLOCK is
+ *  structure, and only 0, ESRCH or (for _check) EAGAIN is
  *  returned: if no (appropriate) requests are done adns_check returns
- *  EWOULDBLOCK; if no (appropriate) requests are outstanding both
+ *  EAGAIN; if no (appropriate) requests are outstanding both
  *  adns_query and adns_wait return ESRCH.
  *
  *  Additionally, _wait can return EINTR if you set adns_if_eintr.
@@ -260,16 +336,114 @@
  *  requested.
  */
 
-int adns_init(adns_state *newstate_r, adns_initflags flags,
+int adns_init(adns_state *newstate_r, int flags /*adns_initflags*/,
 	      FILE *diagfile /*0=>stderr*/);
 
-int adns_init_strcfg(adns_state *newstate_r, adns_initflags flags,
+int adns_init_strcfg(adns_state *newstate_r, int flags /*adns_initflags*/,
 		     FILE *diagfile /*0=>discard*/, const char *configtext);
 
+/* Configuration:
+ *  adns_init reads /etc/resolv.conf, which is expected to be (broadly
+ *  speaking) in the format expected by libresolv.  adns_init_strcfg
+ *  is instead passed a string which is interpreted as if it were the
+ *  contents of resolv.conf.  In general, configuration which is set
+ *  later overrides any that is set earlier.
+ *
+ * Standard directives understood in resolv.conf:
+ * 
+ *  nameserver <address>
+ *   Must be followed by the IP address of a nameserver.  Several
+ *   nameservers may be specified, and they will be tried in the order
+ *   found.  There is a compiled in limit, currently 5, on the number
+ *   of nameservers.  (libresolv supports only 3 nameservers.)
+ *
+ *  search <domain> ...
+ *   Specifies the search list for queries which specify
+ *   adns_qf_search.  This is a list of domains to append to the query
+ *   domain.  The query domain will be tried as-is either before all
+ *   of these or after them, depending on the ndots option setting
+ *   (see below).
+ *
+ *  domain <domain>
+ *   This is present only for backward compatibility with obsolete
+ *   versions of libresolv.  It should not be used, and is interpreted
+ *   by adns as if it were `search' - note that this is subtly
+ *   different to libresolv's interpretation of this directive.
+ *
+ *  sortlist <addr>/<mask> ...
+ *   Should be followed by a sequence of IP-address and netmask pairs,
+ *   separated by spaces.  They may be specified as
+ *   eg. 172.30.206.0/24 or 172.30.206.0/255.255.255.0.  Currently up
+ *   to 15 pairs may be specified (but note that libresolv only
+ *   supports up to 10).
+ *
+ *  options
+ *   Should followed by one or more options, separated by spaces.
+ *   Each option consists of an option name, followed by optionally
+ *   a colon and a value.  Options are listed below.
+ *
+ * Non-standard directives understood in resolv.conf:
+ *
+ *  clearnameservers
+ *   Clears the list of nameservers, so that further nameserver lines
+ *   start again from the beginning.
+ *
+ *  include <filename>
+ *   The specified file will be read.
+ *
+ * Additionally, adns will ignore lines in resolv.conf which start with a #.
+ *
+ * Standard options understood:
+ *
+ *  debug
+ *   Enables debugging output from the resolver, which will be written
+ *   to stderr.
+ *
+ *  ndots:<count>
+ *   Affects whether queries with adns_qf_search will be tried first
+ *   without adding domains from the searchlist, or whether the bare
+ *   query domain will be tried last.  Queries which contain at least
+ *   <count> dots will be tried bare first.  The default is 1.
+ *
+ * Non-standard options understood:
+ *
+ *  adns_checkc:none
+ *  adns_checkc:entex
+ *  adns_checkc:freq
+ *   Changes the consistency checking frequency; this overrides the
+ *   setting of adns_if_check_entex, adns_if_check_freq, or neither,
+ *   in the flags passed to adns_init.
+ * 
+ * There are a number of environment variables which can modify the
+ * behaviour of adns.  They take effect only if adns_init is used, and
+ * the caller of adns_init can disable them using adns_if_noenv.  In
+ * each case there is both a FOO and an ADNS_FOO; the latter is
+ * interpreted later so that it can override the former.  Unless
+ * otherwise stated, environment variables are interpreted after
+ * resolv.conf is read, in the order they are listed here.
+ *
+ *  RES_CONF, ADNS_RES_CONF
+ *   A filename, whose contets are in the format of resolv.conf.
+ *
+ *  RES_CONF_TEXT, ADNS_RES_CONF_TEXT
+ *   A string in the format of resolv.conf.
+ *
+ *  RES_OPTIONS, ADNS_RES_OPTIONS
+ *   These are parsed as if they appeared in the `options' line of a
+ *   resolv.conf.  In addition to being parsed at this point in the
+ *   sequence, they are also parsed at the very beginning before
+ *   resolv.conf or any other environment variables are read, so that
+ *   any debug option can affect the processing of the configuration.
+ *
+ *  LOCALDOMAIN, ADNS_LOCALDOMAIN
+ *   These are interpreted as if their contents appeared in a `search'
+ *   line in resolv.conf.
+ */
+
 int adns_synchronous(adns_state ads,
 		     const char *owner,
 		     adns_rrtype type,
-		     adns_queryflags flags,
+		     int flags /*adns_queryflags*/,
 		     adns_answer **answer_r);
 
 /* NB: if you set adns_if_noautosys then _submit and _check do not
@@ -280,10 +454,12 @@
 int adns_submit(adns_state ads,
 		const char *owner,
 		adns_rrtype type,
-		adns_queryflags flags,
+		int flags /*adns_queryflags*/,
 		void *context,
 		adns_query *query_r);
 
+/* The owner should be quoted in master file format. */
+
 int adns_check(adns_state ads,
 	       adns_query *query_io,
 	       adns_answer **answer_r,
@@ -294,6 +470,12 @@
 	      adns_answer **answer_r,
 	      void **context_r);
 
+/* same as adns_wait but uses poll(2) internally */
+int adns_wait_poll(adns_state ads,
+		   adns_query *query_io,
+		   adns_answer **answer_r,
+		   void **context_r);
+
 void adns_cancel(adns_query query);
 
 /* The adns_query you get back from _submit is valid (ie, can be
@@ -308,6 +490,16 @@
  * query type.
  */
 
+int adns_submit_reverse(adns_state ads,
+			const struct sockaddr *addr,
+			adns_rrtype type,
+			int flags /*adns_queryflags*/,
+			void *context,
+			adns_query *query_r);
+/* type must be _r_ptr or _r_ptr_raw.  _qf_search is ignored.
+ * addr->sa_family must be AF_INET or you get ENOSYS.
+ */
+
 void adns_finish(adns_state ads);
 /* You may call this even if you have queries outstanding;
  * they will be cancelled.
@@ -331,6 +523,13 @@
  * context_r may be 0.  *context_r may not be set when _next returns 0.
  */
 
+void adns_checkconsistency(adns_state ads, adns_query qu);
+/* Checks the consistency of adns's internal data structures.
+ * If any error is found, the program will abort().
+ * You may pass 0 for qu; if you pass non-null then additional checks
+ * are done to make sure that qu is a valid query.
+ */
+
 /*
  * Example expected/legal calling sequence for submit/check/wait:
  *  adns_init
@@ -338,7 +537,7 @@
  *  adns_submit 2
  *  adns_submit 3
  *  adns_wait 1
- *  adns_check 3 -> EWOULDBLOCK
+ *  adns_check 3 -> EAGAIN
  *  adns_wait 2
  *  adns_wait 3
  *  ....
@@ -370,7 +569,7 @@
  * from, or send outgoing data via, fd.  Very like _processany.  If it
  * returns zero then fd will no longer be readable or writeable
  * (unless of course more data has arrived since).  adns will _only_
- * that fd and only in the manner specified, regardless of whether
+ * use that fd and only in the manner specified, regardless of whether
  * adns_if_noautosys was specified.
  *
  * adns_processexceptional should be called when select(2) reports an
@@ -496,7 +695,7 @@
  * in *nfds_io, and always return either 0 (if it is not interested in
  * any fds) or ERANGE (if it is).
  *
- * NOTE that (unless timeout_io is 0) adns may acquire additional fds
+ * NOTE that (unless now is 0) adns may acquire additional fds
  * from one call to the next, so you must put adns_beforepoll in a
  * loop, rather than assuming that the second call (with the buffer
  * size requested by the first) will not return ERANGE.
@@ -517,9 +716,11 @@
  * adns_beforepoll will return 0 on success, and will not fail for any
  * reason other than the fds buffer being too small (ERANGE).
  *
- * This call will never actually do any I/O, or change the fds that
- * adns is using or the timeouts it wants; and in any case it won't
- * block.
+ * This call will never actually do any I/O.  If you supply the
+ * current time it will not change the fds that adns is using or the
+ * timeouts it wants.
+ *
+ * In any case this call won't block.
  */
 
 #define ADNS_POLLFDS_RECOMMENDED 2
@@ -541,21 +742,22 @@
 			 const char **rrtname_r, const char **fmtname_r,
 			 int *len_r,
 			 const void *datap, char **data_r);
-/* Gets information in human-readable (but non-i18n) form
- * for eg debugging purposes.  type must be specified,
- * and the official name of the corresponding RR type will
- * be returned in *rrtname_r, and information about the processing
- * style in *fmtname_r.  The length of the table entry in an answer
- * for that type will be returned in in *len_r.
- * Any or all of rrtname_r, fmtname_r and len_r may be 0.
- * If fmtname_r is non-null then *fmtname_r may be
- * null on return, indicating that no special processing is
- * involved.
- *
- * data_r be must be non-null iff datap is.  In this case
- * *data_r will be set to point to a human-readable text
- * string representing the RR data.  The text will have
- * been obtained from malloc() and must be freed by the caller.
+/*
+ * Get information about a query type, or convert reply data to a
+ * textual form.  type must be specified, and the official name of the
+ * corresponding RR type will be returned in *rrtname_r, and
+ * information about the processing style in *fmtname_r.  The length
+ * of the table entry in an answer for that type will be returned in
+ * in *len_r.  Any or all of rrtname_r, fmtname_r and len_r may be 0.
+ * If fmtname_r is non-null then *fmtname_r may be null on return,
+ * indicating that no special processing is involved.
+ *
+ * data_r be must be non-null iff datap is.  In this case *data_r will
+ * be set to point to a string pointing to a representation of the RR
+ * data in master file format.  (The owner name, timeout, class and
+ * type will not be present - only the data part of the RR.)  The
+ * memory will have been obtained from malloc() and must be freed by
+ * the caller.
  *
  * Usually this routine will succeed.  Possible errors include:
  *  adns_s_nomemory
@@ -563,13 +765,47 @@
  *  adns_s_invaliddata (*datap contained garbage)
  * If an error occurs then no memory has been allocated,
  * and *rrtname_r, *fmtname_r, *len_r and *data_r are undefined.
+ *
+ * There are some adns-invented data formats which are not official
+ * master file formats.  These include:
+ *
+ * Mailboxes if __qtf_mail822: these are just included as-is.
+ *
+ * Addresses (adns_rr_addr): these may be of pretty much any type.
+ * The representation is in two parts: first, a word for the address
+ * family (ie, in AF_XXX, the XXX), and then one or more items for the
+ * address itself, depending on the format.  For an IPv4 address the
+ * syntax is INET followed by the dotted quad (from inet_ntoa).
+ * Currently only IPv4 is supported.
+ *
+ * Text strings (as in adns_rr_txt) appear inside double quotes, and
+ * use \" and \\ to represent " and \, and \xHH to represent
+ * characters not in the range 32-126.
+ *
+ * Hostname with addresses (adns_rr_hostaddr): this consists of the
+ * hostname, as usual, followed by the adns_status value, as an
+ * abbreviation, and then a descriptive string (encoded as if it were
+ * a piece of text), for the address lookup, followed by zero or more
+ * addresses enclosed in ( and ).  If the result was a permanent
+ * failure, then a single ?  appears instead of the ( ).  If the
+ * result was a temporary failure then an empty pair of parentheses
+ * appears (which a space in between).  For example, one of the NS
+ * records for greenend.org.uk comes out like
+ *  ns.chiark.greenend.org.uk ok "OK" ( INET 195.224.76.132 )
+ * an MX referring to a nonexistent host might come out like:
+ *  50 sun2.nsfnet-relay.ac.uk nxdomain "No such domain" ( )
+ * and if nameserver information is not available you might get:
+ *  dns2.spong.dyn.ml.org timeout "DNS query timed out" ?
  */
 
 const char *adns_strerror(adns_status st);
 const char *adns_errabbrev(adns_status st);
+const char *adns_errtypeabbrev(adns_status st);
 /* Like strerror but for adns_status values.  adns_errabbrev returns
  * the abbreviation of the error - eg, for adns_s_timeout it returns
- * "timeout".  You MUST NOT call these functions with status values
+ * "timeout".  adns_errtypeabbrev returns the abbreviation of the
+ * error class: ie, for values up to adns_s_max_XXX it will return the
+ * string XXX.  You MUST NOT call these functions with status values
  * not returned by the same adns library.
  */
 
Index: adns/src/adns.make
diff -u adns/src/adns.make:1.3 adns/src/adns.make:1.5
--- adns/src/adns.make:1.3	Mon Jul  5 02:51:05 1999
+++ adns/src/adns.make	Sun Oct 10 14:16:24 1999
@@ -1,6 +1,11 @@
 # src/adns.make - library definitions, including list of object files
 # 
-#  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+#  This file is
+#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#
+#  It is part of adns, which is
+#    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+#    Copyright (C) 1999 Tony Finch <dot@dotat.at>
 #  
 #  This program is free software; you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
@@ -17,4 +22,4 @@
 #  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
 
 LIBOBJS=	types.o event.o query.o reply.o general.o setup.o transmit.o \
-		parse.o poll.o
+		parse.o poll.o check.o
Index: adns/src/check.c
diff -u /dev/null adns/src/check.c:1.5
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/src/check.c	Tue Oct 12 20:51:08 1999
@@ -0,0 +1,189 @@
+/*
+ * check.c
+ * - consistency checks
+ */
+/*
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *  
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software Foundation,
+ *  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
+ */
+
+#include "internal.h"
+
+void adns_checkconsistency(adns_state ads, adns_query qu) {
+  adns__consistency(ads,qu,cc_user);
+}
+
+#define DLIST_CHECK(list, nodevar, part, body)					\
+  if ((list).head) {								\
+    assert(! (list).head->part back);						\
+    for ((nodevar)= (list).head; (nodevar); (nodevar)= (nodevar)->part next) {	\
+      assert((nodevar)->part next						\
+	     ? (nodevar) == (nodevar)->part next->part back			\
+	     : (nodevar) == (list).tail);					\
+      body									\
+    }										\
+  }
+
+#define DLIST_ASSERTON(node, nodevar, list, part)				\
+  do {										\
+    for ((nodevar)= (list).head;						\
+	 (nodevar) != (node);							\
+	 (nodevar)= (nodevar)->part next) {					\
+      assert((nodevar));							\
+    }										\
+  } while(0)
+
+static void checkc_query_alloc(adns_state ads, adns_query qu) {
+  allocnode *an;
+
+  DLIST_CHECK(qu->allocations, an, , {
+  });
+}
+
+static void checkc_query(adns_state ads, adns_query qu) {
+  adns_query child;
+
+  assert(qu->udpnextserver < ads->nservers);
+  assert(!(qu->udpsent & (~0UL << ads->nservers)));
+  assert(!(qu->tcpfailed & (~0UL << ads->nservers)));
+  assert(qu->udpretries <= UDPMAXRETRIES);
+  assert(qu->search_pos <= ads->nsearchlist);
+  if (qu->parent) DLIST_ASSERTON(qu, child, qu->parent->children, siblings.);
+}
+
+static void checkc_global(adns_state ads) {
+  int i;
+  
+  assert(ads->udpsocket >= 0);
+
+  for (i=0; i<ads->nsortlist; i++)
+    assert(!(ads->sortlist[i].base.s_addr & ~ads->sortlist[i].mask.s_addr));
+
+  assert(ads->tcpserver >= 0 && ads->tcpserver < ads->nservers);
+  
+  switch (ads->tcpstate) {
+  case server_connecting:
+    assert(ads->tcpsocket >= 0);
+  case server_disconnected: /* fall through */
+    assert(!ads->tcpsend.used);
+    assert(!ads->tcprecv.used);
+    assert(!ads->tcprecv_skip);
+    break;
+  case server_ok:
+    assert(ads->tcpsocket >= 0);
+    assert(ads->tcprecv_skip <= ads->tcprecv.used);
+    break;
+  default:
+    assert(!"ads->tcpstate value");
+  }
+
+  assert(ads->searchlist || !ads->nsearchlist);
+}
+
+static void checkc_queue_timew(adns_state ads) {
+  adns_query qu;
+  
+  DLIST_CHECK(ads->timew, qu, , {
+    switch (qu->state) {
+    case query_tosend:
+      assert(qu->udpsent);
+      assert(!qu->tcpfailed);
+      break;
+    case query_tcpwait:
+      assert(ads->tcpstate != server_ok);
+      break;
+    case query_tcpsent:
+      break;
+    default:
+      assert(!"timew state");
+    }
+    assert(!qu->children.head && !qu->children.tail);
+    checkc_query(ads,qu);
+    checkc_query_alloc(ads,qu);
+  });
+}
+
+static void checkc_queue_childw(adns_state ads) {
+  adns_query parent, child;
+
+  DLIST_CHECK(ads->childw, parent, , {
+    assert(parent->state == query_child);
+    assert(parent->children.head);
+    DLIST_CHECK(parent->children, child, siblings., {
+      assert(child->parent == parent);
+      assert(child->state != query_done);
+    });
+    checkc_query(ads,parent);
+    checkc_query_alloc(ads,parent);
+  });
+}
+
+static void checkc_queue_output(adns_state ads) {
+  adns_query qu;
+  
+  DLIST_CHECK(ads->output, qu, , {
+    assert(qu->state == query_done);
+    assert(!qu->children.head && !qu->children.tail);
+    assert(!qu->parent);
+    assert(!qu->allocations.head && !qu->allocations.tail);
+    checkc_query(ads,qu);
+  });
+}
+
+void adns__consistency(adns_state ads, adns_query qu, consistency_checks cc) {
+  adns_query search;
+  
+  switch (cc) {
+  case cc_user:
+    break;
+  case cc_entex:
+    if (!(ads->iflags & adns_if_checkc_entex)) return;
+    break;
+  case cc_freq:
+    if ((ads->iflags & adns_if_checkc_freq) != adns_if_checkc_freq) return;
+    break;
+  default:
+    abort();
+  }
+
+  checkc_global(ads);
+  checkc_queue_timew(ads);
+  checkc_queue_childw(ads);
+  checkc_queue_output(ads);
+
+  if (qu) {
+    switch (qu->state) {
+    case query_tosend:
+    case query_tcpwait:
+    case query_tcpsent:
+      DLIST_ASSERTON(qu, search, ads->timew, );
+      break;
+    case query_child:
+      DLIST_ASSERTON(qu, search, ads->childw, );
+      break;
+    case query_done:
+      DLIST_ASSERTON(qu, search, ads->output, );
+      break;
+    default:
+      assert(!"specific query state");
+    }
+  }
+}
Index: adns/src/config.h.in
diff -u adns/src/config.h.in:1.4 adns/src/config.h.in:1.5
--- adns/src/config.h.in:1.4	Thu Jul 29 23:29:27 1999
+++ adns/src/config.h.in	Thu Aug  5 22:38:34 1999
@@ -12,6 +12,9 @@
 /* Define if printf-format argument lists a la GCC are available.  */
 #undef HAVE_GNUC25_PRINTFFORMAT
 
+/* Define if we want to include rpc/types.h.  Crap BSDs put INADDR_LOOPBACK there. */
+#undef HAVEUSE_RPCTYPES_H
+
 /* Define if you have the poll function.  */
 #undef HAVE_POLL
 
@@ -81,4 +84,8 @@
 #endif
 #ifndef CONSTANT
 #define CONSTANT FUNCATTR((ATTRCONST))
+#endif
+
+#ifdef HAVEUSE_RPCTYPES_H
+#include <rpc/types.h>
 #endif
Index: adns/src/dlist.h
diff -u /dev/null adns/src/dlist.h:1.1
--- /dev/null	Wed Oct 13 02:34:30 1999
+++ adns/src/dlist.h	Tue Oct 12 20:51:08 1999
@@ -0,0 +1,53 @@
+/*
+ * dlist.h
+ * - macros for handling doubly linked lists
+ */
+/*
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
+ *  
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *  
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *  
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software Foundation,
+ *  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
+ */
+
+#ifndef ADNS_DLIST_H_INCLUDED
+#define ADNS_DLIST_H_INCLUDED
+
+#define LIST_INIT(list) ((list).head= (list).tail= 0)
+#define LINK_INIT(link) ((link).next= (link).back= 0)
+
+#define LIST_UNLINK_PART(list,node,part) \
+  do { \
+    if ((node)->part back) (node)->part back->part next= (node)->part next; \
+      else                                  (list).head= (node)->part next; \
+    if ((node)->part next) (node)->part next->part back= (node)->part back; \
+      else                                  (list).tail= (node)->part back; \
+  } while(0)
+
+#define LIST_LINK_TAIL_PART(list,node,part) \
+  do { \
+    (node)->part next= 0; \
+    (node)->part back= (list).tail; \
+    if ((list).tail) (list).tail->part next= (node); else (list).head= (node); \
+    (list).tail= (node); \
+  } while(0)
+
+#define LIST_UNLINK(list,node) LIST_UNLINK_PART(list,node,)
+#define LIST_LINK_TAIL(list,node) LIST_LINK_TAIL_PART(list,node,)
+
+#endif
Index: adns/src/event.c
diff -u adns/src/event.c:1.28 adns/src/event.c:1.40
--- adns/src/event.c:1.28	Fri Jul 30 00:10:50 1999
+++ adns/src/event.c	Wed Oct 13 00:00:08 1999
@@ -5,7 +5,12 @@
  * - user-visible check/wait and event-loop-related functions
  */
 /*
- *  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
  *  
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -22,7 +27,6 @@
  *  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
  */
 
-#include <string.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -43,8 +47,9 @@
   
   serv= ads->tcpserver;
   close(ads->tcpsocket);
+  ads->tcpsocket= -1;
   ads->tcpstate= server_disconnected;
-  ads->tcprecv.used= ads->tcpsend.used= 0;
+  ads->tcprecv.used= ads->tcprecv_skip= ads->tcpsend.used= 0;
   ads->tcpserver= (serv+1)%ads->nservers;
 }
 
@@ -93,6 +98,7 @@
     assert(ads->tcpstate == server_disconnected);
     assert(!ads->tcpsend.used);
     assert(!ads->tcprecv.used);
+    assert(!ads->tcprecv_skip);
 
     proto= getprotobyname("tcp");
     if (!proto) { adns__diag(ads,-1,0,"unable to find protocol no. for TCP !"); return; }
@@ -192,14 +198,18 @@
 void adns_firsttimeout(adns_state ads,
 		       struct timeval **tv_io, struct timeval *tvbuf,
 		       struct timeval now) {
+  adns__consistency(ads,0,cc_entex);
   adns__timeouts(ads, 0, tv_io,tvbuf, now);
+  adns__consistency(ads,0,cc_entex);
 }
 
 void adns_processtimeouts(adns_state ads, const struct timeval *now) {
   struct timeval tv_buf;
 
-  adns__must_gettimeofday(ads,&now,&tv_buf); if (!now) return;
-  adns__timeouts(ads, 1, 0,0, *now);
+  adns__consistency(ads,0,cc_entex);
+  adns__must_gettimeofday(ads,&now,&tv_buf);
+  if (now) adns__timeouts(ads, 1, 0,0, *now);
+  adns__consistency(ads,0,cc_entex);
 }
 
 /* fd handling functions.  These are the top-level of the real work of
@@ -232,33 +242,39 @@
 }
 
 int adns_processreadable(adns_state ads, int fd, const struct timeval *now) {
-  int skip, want, dgramlen, r, udpaddrlen, serv;
+  int want, dgramlen, r, udpaddrlen, serv, old_skip;
   byte udpbuf[DNS_MAXUDP];
   struct sockaddr_in udpaddr;
   
+  adns__consistency(ads,0,cc_entex);
+
   switch (ads->tcpstate) {
   case server_disconnected:
   case server_connecting:
     break;
   case server_ok:
     if (fd != ads->tcpsocket) break;
-    skip= 0;
+    assert(!ads->tcprecv_skip);
     for (;;) {
-      if (ads->tcprecv.used<skip+2) {
-	want= 2;
-      } else {
-	dgramlen= (ads->tcprecv.buf[skip]<<8) | ads->tcprecv.buf[skip+1];
-	if (ads->tcprecv.used<skip+2+dgramlen) {
-	  want= 2+dgramlen;
+      if (ads->tcprecv.used >= ads->tcprecv_skip+2) {
+	dgramlen= ((ads->tcprecv.buf[ads->tcprecv_skip]<<8) |
+	           ads->tcprecv.buf[ads->tcprecv_skip+1]);
+	if (ads->tcprecv.used >= ads->tcprecv_skip+2+dgramlen) {
+	  old_skip= ads->tcprecv_skip;
+	  ads->tcprecv_skip += 2+dgramlen;
+	  adns__procdgram(ads, ads->tcprecv.buf+old_skip+2,
+			  dgramlen, ads->tcpserver, 1,*now);
+	  continue;
 	} else {
-	  adns__procdgram(ads,ads->tcprecv.buf+skip+2,dgramlen,ads->tcpserver,1,*now);
-	  skip+= 2+dgramlen; continue;
+	  want= 2+dgramlen;
 	}
+      } else {
+	want= 2;
       }
-      ads->tcprecv.used -= skip;
-      memmove(ads->tcprecv.buf,ads->tcprecv.buf+skip,ads->tcprecv.used);
-      skip= 0;
-      if (!adns__vbuf_ensure(&ads->tcprecv,want)) return ENOMEM;
+      ads->tcprecv.used -= ads->tcprecv_skip;
+      memmove(ads->tcprecv.buf,ads->tcprecv.buf+ads->tcprecv_skip,ads->tcprecv.used);
+      ads->tcprecv_skip= 0;
+      if (!adns__vbuf_ensure(&ads->tcprecv,want)) { r= ENOMEM; goto xit; }
       assert(ads->tcprecv.used <= ads->tcprecv.avail);
       if (ads->tcprecv.used == ads->tcprecv.avail) continue;
       r= read(ads->tcpsocket,
@@ -268,12 +284,12 @@
 	ads->tcprecv.used+= r;
       } else {
 	if (r) {
-	  if (errno==EAGAIN || errno==EWOULDBLOCK) return 0;
+	  if (errno==EAGAIN || errno==EWOULDBLOCK) { r= 0; goto xit; }
 	  if (errno==EINTR) continue;
-	  if (errno_resources(errno)) return errno;
+	  if (errno_resources(errno)) { r= errno; goto xit; }
 	}
 	adns__tcp_broken(ads,"read",r?strerror(errno):"closed");
-	return 0;
+	r= 0; goto xit;
       }
     } /* never reached */
   default:
@@ -285,11 +301,11 @@
       r= recvfrom(ads->udpsocket,udpbuf,sizeof(udpbuf),0,
 		  (struct sockaddr*)&udpaddr,&udpaddrlen);
       if (r<0) {
-	if (errno == EAGAIN || errno == EWOULDBLOCK) return 0;
+	if (errno == EAGAIN || errno == EWOULDBLOCK) { r= 0; goto xit; }
 	if (errno == EINTR) continue;
-	if (errno_resources(errno)) return errno;
+	if (errno_resources(errno)) { r= errno; goto xit; }
 	adns__warn(ads,-1,0,"datagram receive error: %s",strerror(errno));
-	return 0;
+	r= 0; goto xit;
       }
       if (udpaddrlen != sizeof(udpaddr)) {
 	adns__diag(ads,-1,0,"datagram received with wrong address length %d"
@@ -318,33 +334,39 @@
       adns__procdgram(ads,udpbuf,r,serv,0,*now);
     }
   }
-  return 0;
+  r= 0;
+xit:
+  adns__consistency(ads,0,cc_entex);
+  return r;
 }
 
 int adns_processwriteable(adns_state ads, int fd, const struct timeval *now) {
   int r;
   
+  adns__consistency(ads,0,cc_entex);
+
   switch (ads->tcpstate) {
   case server_disconnected:
     break;
   case server_connecting:
     if (fd != ads->tcpsocket) break;
     assert(ads->tcprecv.used==0);
+    assert(ads->tcprecv_skip==0);
     for (;;) {
-      if (!adns__vbuf_ensure(&ads->tcprecv,1)) return ENOMEM;
+      if (!adns__vbuf_ensure(&ads->tcprecv,1)) { r= ENOMEM; goto xit; }
       r= read(ads->tcpsocket,&ads->tcprecv.buf,1);
       if (r==0 || (r<0 && (errno==EAGAIN || errno==EWOULDBLOCK))) {
 	tcp_connected(ads,*now);
-	return 0;
+	r= 0; goto xit;
       }
       if (r>0) {
 	adns__tcp_broken(ads,"connect/read","sent data before first request");
-	return 0;
+	r= 0; goto xit;
       }
       if (errno==EINTR) continue;
-      if (errno_resources(errno)) return errno;
+      if (errno_resources(errno)) { r= errno; goto xit; }
       adns__tcp_broken(ads,"connect/read",strerror(errno));
-      return 0;
+      r= 0; goto xit;
     } /* not reached */
   case server_ok:
     if (!(ads->tcpsend.used && fd == ads->tcpsocket)) break;
@@ -354,10 +376,10 @@
       adns__sigpipe_unprotect(ads);
       if (r<0) {
 	if (errno==EINTR) continue;
-	if (errno==EAGAIN || errno==EWOULDBLOCK) return 0;
-	if (errno_resources(errno)) return errno;
+	if (errno==EAGAIN || errno==EWOULDBLOCK) { r= 0; goto xit; }
+	if (errno_resources(errno)) { r= errno; goto xit; }
 	adns__tcp_broken(ads,"write",strerror(errno));
-	return 0;
+	r= 0; goto xit;
       } else if (r>0) {
 	ads->tcpsend.used -= r;
 	memmove(ads->tcpsend.buf,ads->tcpsend.buf+r,ads->tcpsend.used);
@@ -366,10 +388,14 @@
   default:
     abort();
   }
-  return 0;
+  r= 0;
+xit:
+  adns__consistency(ads,0,cc_entex);
+  return r;
 }
   
 int adns_processexceptional(adns_state ads, int fd, const struct timeval *now) {
+  adns__consistency(ads,0,cc_entex);
   switch (ads->tcpstate) {
   case server_disconnected:
     break;
@@ -377,10 +403,11 @@
   case server_ok:
     if (fd != ads->tcpsocket) break;
     adns__tcp_broken(ads,"poll/select","exceptional condition detected");
-    return 0;
+    break;
   default:
     abort();
   }
+  adns__consistency(ads,0,cc_entex);
   return 0;
 }
 
@@ -431,10 +458,12 @@
   struct pollfd pollfds[MAX_POLLFDS];
   int i, fd, maxfd, npollfds;
   
+  adns__consistency(ads,0,cc_entex);
+
   if (tv_mod && (!*tv_mod || (*tv_mod)->tv_sec || (*tv_mod)->tv_usec)) {
     /* The caller is planning to sleep. */
     adns__must_gettimeofday(ads,&now,&tv_nowbuf);
-    if (!now) return;
+    if (!now) goto xit;
     adns__timeouts(ads, 1, tv_mod,tv_tobuf, *now);
   }
 
@@ -448,6 +477,9 @@
     if (pollfds[i].events & POLLPRI) FD_SET(fd,exceptfds_io);
   }
   *maxfd_io= maxfd;
+
+xit:
+  adns__consistency(ads,0,cc_entex);
 }
 
 void adns_afterselect(adns_state ads, int maxfd, const fd_set *readfds,
@@ -457,8 +489,9 @@
   struct pollfd pollfds[MAX_POLLFDS];
   int npollfds, i;
 
+  adns__consistency(ads,0,cc_entex);
   adns__must_gettimeofday(ads,&now,&tv_buf);
-  if (!now) return;
+  if (!now) goto xit;
   adns_processtimeouts(ads,now);
 
   npollfds= adns__pollfds(ads,pollfds);
@@ -467,11 +500,15 @@
 		 pollfds,npollfds,
 		 maxfd,readfds,writefds,exceptfds,
 		 *now, 0);
+xit:
+  adns__consistency(ads,0,cc_entex);
 }
 
 /* General helpful functions. */
 
 void adns_globalsystemfailure(adns_state ads) {
+  adns__consistency(ads,0,cc_entex);
+
   while (ads->timew.head) {
     adns__query_fail(ads->timew.head, adns_s_systemfail);
   }
@@ -486,23 +523,33 @@
   default:
     abort();
   }
+  adns__consistency(ads,0,cc_entex);
 }
 
 int adns_processany(adns_state ads) {
-  int r;
+  int r, i;
   struct timeval now;
   struct pollfd pollfds[MAX_POLLFDS];
   int npollfds;
 
+  adns__consistency(ads,0,cc_entex);
+
   r= gettimeofday(&now,0);
   if (!r) adns_processtimeouts(ads,&now);
 
+  /* We just use adns__fdevents to loop over the fd's trying them.
+   * This seems more sensible than calling select, since we're most
+   * likely just to want to do a read on one or two fds anyway.
+   */
   npollfds= adns__pollfds(ads,pollfds);
+  for (i=0; i<npollfds; i++) pollfds[i].revents= pollfds[i].events;
   adns__fdevents(ads,
 		 pollfds,npollfds,
 		 0,0,0,0,
 		 now,&r);
-  return r;
+
+  adns__consistency(ads,0,cc_entex);
+  return 0;
 }
 
 void adns__autosys(adns_state ads, struct timeval now) {
@@ -510,18 +557,23 @@
   adns_processany(ads);
 }
 
-static int internal_check(adns_state ads,
-			  adns_query *query_io,
-			  adns_answer **answer,
-			  void **context_r) {
+int adns__internal_check(adns_state ads,
+			 adns_query *query_io,
+			 adns_answer **answer,
+			 void **context_r) {
   adns_query qu;
 
   qu= *query_io;
   if (!qu) {
-    if (!ads->output.head) return EWOULDBLOCK;
-    qu= ads->output.head;
+    if (ads->output.head) {
+      qu= ads->output.head;
+    } else if (ads->timew.head) {
+      return EAGAIN;
+    } else {
+      return ESRCH;
+    }
   } else {
-    if (qu->id>=0) return EWOULDBLOCK;
+    if (qu->id>=0) return EAGAIN;
   }
   LIST_UNLINK(ads->output,qu);
   *answer= qu->answer;
@@ -539,16 +591,17 @@
   fd_set readfds, writefds, exceptfds;
   struct timeval tvbuf, *tvp;
   
+  adns__consistency(ads,*query_io,cc_entex);
   for (;;) {
-    r= internal_check(ads,query_io,answer_r,context_r);
-    if (r != EWOULDBLOCK) return r;
+    r= adns__internal_check(ads,query_io,answer_r,context_r);
+    if (r != EAGAIN) break;
     maxfd= 0; tvp= 0;
     FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds);
     adns_beforeselect(ads,&maxfd,&readfds,&writefds,&exceptfds,&tvp,&tvbuf,0);
     rsel= select(maxfd,&readfds,&writefds,&exceptfds,tvp);
     if (rsel==-1) {
       if (errno == EINTR) {
-	if (ads->iflags & adns_if_eintr) return EINTR;
+	if (ads->iflags & adns_if_eintr) { r= EINTR; break; }
       } else {
 	adns__diag(ads,-1,0,"select failed in wait: %s",strerror(errno));
 	adns_globalsystemfailure(ads);
@@ -558,6 +611,8 @@
       adns_afterselect(ads,maxfd,&readfds,&writefds,&exceptfds,0);
     }
   }
+  adns__consistency(ads,0,cc_entex);
+  return r;
 }
 
 int adns_check(adns_state ads,
@@ -567,8 +622,11 @@
   struct timeval now;
   int r;
   
+  adns__consistency(ads,*query_io,cc_entex);
   r= gettimeofday(&now,0);
   if (!r) adns__autosys(ads,now);
-  
-  return internal_check(ads,query_io,answer_r,context_r);
+
+  r= adns__internal_check(ads,query_io,answer_r,context_r);
+  adns__consistency(ads,0,cc_entex);
+  return r;
 }
Index: adns/src/general.c
diff -u adns/src/general.c:1.19 adns/src/general.c:1.23
--- adns/src/general.c:1.19	Wed Jul 28 23:11:13 1999
+++ adns/src/general.c	Wed Oct 13 01:23:01 1999
@@ -4,7 +4,12 @@
  * - vbuf handling
  */
 /*
- *  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
  *  
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -22,7 +27,6 @@
  */
 
 #include <stdlib.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -200,6 +204,7 @@
   return st;
 }
 
+
 #define SINFO(n,s) { adns_s_##n, #n, s }
 
 static const struct sinfo {
@@ -226,7 +231,7 @@
   SINFO(  rcodeunknown,        "Nameserver sent unknown response code"         ),
   
   SINFO(  inconsistent,        "Inconsistent resource records in DNS"          ),
-  SINFO(  prohibitedcname,     "DNS data refers to an alias"                   ),
+  SINFO(  prohibitedcname,     "DNS alias found where canonical name wanted"   ),
   SINFO(  answerdomaininvalid, "Found syntactically invalid domain name"       ),
   SINFO(  answerdomaintoolong, "Found overly-long domain name"                 ),
   SINFO(  invaliddata,         "Found invalid DNS data"                        ),
@@ -236,7 +241,7 @@
   SINFO(  querydomaintoolong,  "Domain name is too long"                       ),
 
   SINFO(  nxdomain,            "No such domain"                                ),
-  SINFO(  nodata,              "No such data"                                  ),
+  SINFO(  nodata,              "No such data"                                  )
 };
 
 static int si_compar(const void *key, const void *elem) {
@@ -263,6 +268,43 @@
   si= findsinfo(st);
   return si->abbrev;
 }
+
+
+#define STINFO(max) { adns_s_max_##max, #max }
+
+static const struct stinfo {
+  adns_status stmax;
+  const char *abbrev;
+} stinfos[]= {
+  { adns_s_ok, "ok" },
+  STINFO(  localfail   ),
+  STINFO(  remotefail  ),
+  STINFO(  tempfail    ),
+  STINFO(  misconfig   ),
+  STINFO(  misquery    ),
+  STINFO(  permfail    )
+};
+
+static int sti_compar(const void *key, const void *elem) {
+  const adns_status *st= key;
+  const struct stinfo *sti= elem;
+
+  adns_status here, min, max;
+
+  here= *st;
+  min= (sti==stinfos) ? 0 : sti[-1].stmax+1;
+  max= sti->stmax;
+  
+  return here < min  ? -1 : here > max ? 1 : 0;
+}
+
+const char *adns_errtypeabbrev(adns_status st) {
+  const struct stinfo *sti;
+
+  sti= bsearch(&st,stinfos,sizeof(stinfos)/sizeof(*stinfos),sizeof(*stinfos),sti_compar);
+  return sti->abbrev;
+}
+
 
 void adns__isort(void *array, int nobjs, int sz, void *tempbuf,
 		 int (*needswap)(void *context, const void *a, const void *b),
Index: adns/src/internal.h
diff -u adns/src/internal.h:1.45 adns/src/internal.h:1.51
--- adns/src/internal.h:1.45	Fri Jul 30 00:10:51 1999
+++ adns/src/internal.h	Tue Oct 12 20:51:08 1999
@@ -5,7 +5,12 @@
  * - comments regarding library data structures
  */
 /*
- *  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
  *  
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -33,10 +38,12 @@
 #include <unistd.h>
 #include <signal.h>
 #include <errno.h>
+#include <string.h>
 
 #include <sys/time.h>
 
 #include "adns.h"
+#include "dlist.h"
 
 /* Configuration and constants */
 
@@ -59,6 +66,12 @@
 #define MAX_POLLFDS  ADNS_POLLFDS_RECOMMENDED
 
 typedef enum {
+  cc_user,
+  cc_entex,
+  cc_freq
+} consistency_checks;
+
+typedef enum {
   rcode_noerror,
   rcode_formaterror,
   rcode_servfail,
@@ -205,14 +218,14 @@
 
   /* Possible states:
    *
-   *  state   Queue   child  id   nextudpserver  sentudp     failedtcp
+   *  state   Queue   child  id   nextudpserver  udpsent     tcpfailed
    *				  
    *  tosend  NONE    null   >=0  0              zero        zero
    *  tosend  timew   null   >=0  any            nonzero     zero
    *  tosend  NONE    null   >=0  any            nonzero     zero
    *				  
-   *  tcpwait timew   null   >=0  irrelevant     zero        any
-   *  tcpsent timew   null   >=0  irrelevant     zero        any
+   *  tcpwait timew   null   >=0  irrelevant     any         any
+   *  tcpsent timew   null   >=0  irrelevant     any         any
    *				  
    *  child   childw  set    >=0  irrelevant     irrelevant  irrelevant
    *  child   NONE    null   >=0  irrelevant     irrelevant  irrelevant
@@ -267,7 +280,7 @@
   adns_query forallnext;
   int nextid, udpsocket, tcpsocket;
   vbuf tcpsend, tcprecv;
-  int nservers, nsortlist, nsearchlist, searchndots, tcpserver;
+  int nservers, nsortlist, nsearchlist, searchndots, tcpserver, tcprecv_skip;
   enum adns__tcpstate { server_disconnected, server_connecting, server_ok } tcpstate;
   struct timeval tcptimeout;
   struct sigaction stdsigpipe;
@@ -619,7 +632,10 @@
 void adns__tcp_tryconnect(adns_state ads, struct timeval now);
 
 void adns__autosys(adns_state ads, struct timeval now);
-/* Make all the system calls we want to if the application wants us to. */
+/* Make all the system calls we want to if the application wants us to.
+ * Must not be called from within adns internal processing functions,
+ * lest we end up in recursive descent !
+ */
 
 void adns__must_gettimeofday(adns_state ads, const struct timeval **now_io,
 			     struct timeval *tv_buf);
@@ -632,7 +648,15 @@
 		    int maxfd, const fd_set *readfds,
 		    const fd_set *writefds, const fd_set *exceptfds,
 		    struct timeval now, int *r_r);
+int adns__internal_check(adns_state ads,
+			 adns_query *query_io,
+			 adns_answer **answer,
+			 void **context_r);
+
+/* From check.c: */
 
+void adns__consistency(adns_state ads, adns_query qu, consistency_checks cc);
+
 /* Useful static inline functions: */
 
 static inline void timevaladd(struct timeval *tv_io, long ms) {
@@ -650,6 +674,7 @@
 static inline int ctype_alpha(int c) {
   return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
 }
+static inline int ctype_822special(int c) { return strchr("()<>@,;:\\\".[]",c) != 0; }
 
 static inline int errno_resources(int e) { return e==ENOMEM || e==ENOBUFS; }
 
@@ -658,28 +683,6 @@
 #define MEM_ROUND(sz) \
   (( ((sz)+sizeof(union maxalign)-1) / sizeof(union maxalign) ) \
    * sizeof(union maxalign) )
-
-#define LIST_INIT(list) ((list).head= (list).tail= 0)
-#define LINK_INIT(link) ((link).next= (link).back= 0)
-
-#define LIST_UNLINK_PART(list,node,part) \
-  do { \
-    if ((node)->part back) (node)->part back->part next= (node)->part next; \
-      else                                  (list).head= (node)->part next; \
-    if ((node)->part next) (node)->part next->part back= (node)->part back; \
-      else                                  (list).tail= (node)->part back; \
-  } while(0)
-
-#define LIST_LINK_TAIL_PART(list,node,part) \
-  do { \
-    (node)->part next= 0; \
-    (node)->part back= (list).tail; \
-    if ((list).tail) (list).tail->part next= (node); else (list).head= (node); \
-    (list).tail= (node); \
-  } while(0)
-
-#define LIST_UNLINK(list,node) LIST_UNLINK_PART(list,node,)
-#define LIST_LINK_TAIL(list,node) LIST_LINK_TAIL_PART(list,node,)
 
 #define GETIL_B(cb) (((dgram)[(cb)++]) & 0x0ff)
 #define GET_B(cb,tv) ((tv)= GETIL_B((cb)))
Index: adns/src/parse.c
diff -u adns/src/parse.c:1.16 adns/src/parse.c:1.17
--- adns/src/parse.c:1.16	Sun Apr 11 20:42:10 1999
+++ adns/src/parse.c	Sun Oct 10 14:16:24 1999
@@ -3,7 +3,12 @@
  * - parsing assistance functions (mainly for domains inside datagrams)
  */
 /*
- *  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
  *  
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
Index: adns/src/poll.c
diff -u adns/src/poll.c:1.2 adns/src/poll.c:1.7
--- adns/src/poll.c:1.2	Sun Jul 11 19:15:17 1999
+++ adns/src/poll.c	Tue Oct 12 23:55:15 1999
@@ -3,7 +3,12 @@
  * - wrappers for poll(2)
  */
 /*
- *  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
  *  
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -21,6 +26,7 @@
  */
 
 #include <limits.h>
+#include <string.h>
 
 #include "internal.h"
 
@@ -29,12 +35,14 @@
 int adns_beforepoll(adns_state ads, struct pollfd *fds, int *nfds_io, int *timeout_io,
 		    const struct timeval *now) {
   struct timeval tv_nowbuf, tv_tobuf, *tv_to;
-  int space, found, timeout_ms;
+  int space, found, timeout_ms, r;
   struct pollfd fds_tmp[MAX_POLLFDS];
 
+  adns__consistency(ads,0,cc_entex);
+
   if (timeout_io) {
     adns__must_gettimeofday(ads,&now,&tv_nowbuf);
-    if (!now) { *nfds_io= 0; return 0; }
+    if (!now) { *nfds_io= 0; r= 0; goto xit; }
 
     timeout_ms= *timeout_io;
     if (timeout_ms == -1) {
@@ -65,21 +73,59 @@
   } else {
     found= adns__pollfds(ads,fds_tmp);
     *nfds_io= found;
-    if (space < found) return ERANGE;
+    if (space < found) { r= ERANGE; goto xit; }
     memcpy(fds,fds_tmp,sizeof(struct pollfd)*found);
   }
-  return 0;
+  r= 0;
+xit:
+  adns__consistency(ads,0,cc_entex);
+  return r;
 }
 
 void adns_afterpoll(adns_state ads, const struct pollfd *fds, int nfds,
 		    const struct timeval *now) {
   struct timeval tv_buf;
 
+  adns__consistency(ads,0,cc_entex);
   adns__must_gettimeofday(ads,&now,&tv_buf);
-  if (!now) return;
+  if (now) {
+    adns__timeouts(ads, 1, 0,0, *now);
+    adns__fdevents(ads, fds,nfds, 0,0,0,0, *now,0);
+  }
+  adns__consistency(ads,0,cc_entex);
+}
+
+int adns_wait_poll(adns_state ads,
+		   adns_query *query_io,
+		   adns_answer **answer_r,
+		   void **context_r) {
+  int r, nfds, to;
+  struct pollfd fds[MAX_POLLFDS];
+  
+  adns__consistency(ads,0,cc_entex);
+
+  for (;;) {
+    r= adns__internal_check(ads,query_io,answer_r,context_r);
+    if (r != EAGAIN) goto xit;
+    nfds= MAX_POLLFDS; to= -1;
+    adns_beforepoll(ads,fds,&nfds,&to,0);
+    r= poll(fds,nfds,to);
+    if (r == -1) {
+      if (errno == EINTR) {
+	if (ads->iflags & adns_if_eintr) { r= EINTR; goto xit; }
+      } else {
+	adns__diag(ads,-1,0,"poll failed in wait: %s",strerror(errno));
+	adns_globalsystemfailure(ads);
+      }
+    } else {
+      assert(r >= 0);
+      adns_afterpoll(ads,fds,nfds,0);
+    }
+  }
 
-  adns__timeouts(ads, 1, 0,0, *now);
-  adns__fdevents(ads, fds,nfds, 0,0,0,0, *now,0);
+ xit:
+  adns__consistency(ads,0,cc_entex);
+  return r;
 }
 
 #endif
Index: adns/src/query.c
diff -u adns/src/query.c:1.39 adns/src/query.c:1.48
--- adns/src/query.c:1.39	Thu Aug  5 01:03:25 1999
+++ adns/src/query.c	Wed Oct 13 02:23:56 1999
@@ -5,7 +5,12 @@
  * - query submission and cancellation (user-visible and internal)
  */
 /*
- *  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
  *  
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -27,7 +32,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <errno.h>
-#include <string.h>
 
 #include <sys/time.h>
 
@@ -101,7 +105,6 @@
   memcpy(qu->query_dgram,qu->vb.buf,qu->vb.used);
   
   adns__query_send(qu,now);
-  adns__autosys(ads,now);
 }
 
 adns_status adns__internal_submit(adns_state ads, adns_query *query_r,
@@ -192,7 +195,7 @@
 int adns_submit(adns_state ads,
 		const char *owner,
 		adns_rrtype type,
-		adns_queryflags flags,
+		int flags,
 		void *context,
 		adns_query *query_r) {
   int r, ol, ndots;
@@ -202,6 +205,8 @@
   adns_query qu;
   const char *p;
 
+  adns__consistency(ads,0,cc_entex);
+
   typei= adns__findtype(type);
   if (!typei) return ENOSYS;
 
@@ -237,22 +242,47 @@
     }
     query_simple(ads,qu, owner,ol, typei,flags, now);
   }
+  adns__autosys(ads,now);
+  adns__consistency(ads,qu,cc_entex);
   return 0;
 
  x_adnsfail:
   adns__query_fail(qu,stat);
+  adns__consistency(ads,qu,cc_entex);
   return 0;
 
  x_errno:
   r= errno;
   assert(r);
+  adns__consistency(ads,0,cc_entex);
   return r;
 }
 
+int adns_submit_reverse(adns_state ads,
+			const struct sockaddr *addr,
+			adns_rrtype type,
+			int flags,
+			void *context,
+			adns_query *query_r) {
+  const unsigned char *iaddr;
+  char buf[30];
+
+  if (type != adns_r_ptr && type != adns_r_ptr_raw) return EINVAL;
+  flags &= ~adns_qf_search;
+
+  if (addr->sa_family != AF_INET) return ENOSYS;
+  iaddr= (const unsigned char*) &(((const struct sockaddr_in*)addr) -> sin_addr);
+
+  sprintf(buf, "%d.%d.%d.%d.in-addr.arpa",
+	  iaddr[3], iaddr[2], iaddr[1], iaddr[0]);
+
+  return adns_submit(ads,buf,type,flags,context,query_r);
+}
+
 int adns_synchronous(adns_state ads,
 		     const char *owner,
 		     adns_rrtype type,
-		     adns_queryflags flags,
+		     int flags,
 		     adns_answer **answer_r) {
   adns_query qu;
   int r;
@@ -342,7 +372,6 @@
     ncqu= cqu->siblings.next;
     adns_cancel(cqu);
   }
-  LIST_INIT(qu->children);
 }
 
 void adns__reset_preserved(adns_query qu) {
@@ -358,19 +387,25 @@
 
   cancel_children(qu);
   for (an= qu->allocations.head; an; an= ann) { ann= an->next; free(an); }
+  LIST_INIT(qu->allocations);
   adns__vbuf_free(&qu->vb);
 }
 
 void adns_cancel(adns_query qu) {
+  adns_state ads;
+
+  ads= qu->ads;
+  adns__consistency(ads,qu,cc_entex);
+  if (qu->parent) LIST_UNLINK_PART(qu->parent->children,qu,siblings.);
   switch (qu->state) {
   case query_tosend: case query_tcpwait: case query_tcpsent:
-    LIST_UNLINK(qu->ads->timew,qu);
+    LIST_UNLINK(ads->timew,qu);
     break;
   case query_child:
-    LIST_UNLINK(qu->ads->childw,qu);
+    LIST_UNLINK(ads->childw,qu);
     break;
   case query_done:
-    LIST_UNLINK(qu->ads->output,qu);
+    LIST_UNLINK(ads->output,qu);
     break;
   default:
     abort();
@@ -378,6 +413,7 @@
   free_query_allocs(qu);
   free(qu->answer);
   free(qu);
+  adns__consistency(ads,0,cc_entex);
 }
 
 void adns__update_expires(adns_query qu, unsigned long ttl, struct timeval now) {
@@ -464,6 +500,7 @@
   } else {
     makefinal_query(qu);
     LIST_LINK_TAIL(qu->ads->output,qu);
+    qu->state= query_done;
   }
 }
 
Index: adns/src/reply.c
diff -u adns/src/reply.c:1.30 adns/src/reply.c:1.33
--- adns/src/reply.c:1.30	Thu Aug  5 01:03:25 1999
+++ adns/src/reply.c	Sun Oct 10 14:16:24 1999
@@ -3,7 +3,12 @@
  * - main handling and parsing routine for received datagrams
  */
 /*
- *  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
  *  
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -21,7 +26,6 @@
  */
 
 #include <stdlib.h>
-#include <string.h>
 
 #include "internal.h"
     
@@ -168,9 +172,11 @@
 	adns__query_fail(qu,adns_s_prohibitedcname);
 	return;
       } else if (qu->cname_dgram) { /* Ignore second and subsequent CNAME(s) */
-	adns__debug(ads,serv,qu,"ignoring duplicate CNAME (%s, as well as %s)",
-		    adns__diag_domain(ads,serv,qu, &qu->vb, dgram,dglen,rdstart),
-		    qu->answer->cname);
+	adns__debug(ads,serv,qu,"allegedly canonical name %s is actually alias for %s",
+		    qu->answer->cname,
+		    adns__diag_domain(ads,serv,qu, &qu->vb, dgram,dglen,rdstart));
+	adns__query_fail(qu,adns_s_prohibitedcname);
+	return;
       } else if (wantedrrs) { /* Ignore CNAME(s) after RR(s). */
 	adns__debug(ads,serv,qu,"ignoring CNAME (to %s) coexisting with RR",
 		    adns__diag_domain(ads,serv,qu, &qu->vb, dgram,dglen,rdstart));
Index: adns/src/setup.c
diff -u adns/src/setup.c:1.24 adns/src/setup.c:1.30
--- adns/src/setup.c:1.24	Thu Jul 29 22:35:17 1999
+++ adns/src/setup.c	Wed Oct 13 02:23:56 1999
@@ -4,7 +4,12 @@
  * - management of global state
  */
 /*
- *  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
  *  
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -23,7 +28,6 @@
 
 #include <stdlib.h>
 #include <errno.h>
-#include <string.h>
 #include <limits.h>
 #include <unistd.h>
 #include <fcntl.h>
@@ -227,6 +231,21 @@
       ads->searchndots= v;
       continue;
     }
+    if (l>=12 && !memcmp(word,"adns_checkc:",12)) {
+      if (!strcmp(word+12,"none")) {
+	ads->iflags &= ~adns_if_checkc_freq;
+	ads->iflags |= adns_if_checkc_entex;
+      } else if (!strcmp(word+12,"entex")) {
+	ads->iflags &= ~adns_if_checkc_freq;
+	ads->iflags |= adns_if_checkc_entex;
+      } else if (!strcmp(word+12,"freq")) {
+	ads->iflags |= adns_if_checkc_freq;
+      } else {
+	configparseerr(ads,fn,lno, "option adns_checkc has bad value `%s' "
+		       "(must be none, entex or freq", word+12);
+      }
+      continue;
+    }
     adns__diag(ads,-1,0,"%s:%d: unknown option `%.*s'", fn,lno, l,word);
   }
 }
@@ -450,6 +469,7 @@
   ads->udpsocket= ads->tcpsocket= -1;
   adns__vbuf_init(&ads->tcpsend);
   adns__vbuf_init(&ads->tcprecv);
+  ads->tcprecv_skip= 0;
   ads->nservers= ads->nsortlist= ads->nsearchlist= ads->tcpserver= 0;
   ads->searchndots= 1;
   ads->tcpstate= server_disconnected;
@@ -496,7 +516,7 @@
   free(ads);
 }
 
-int adns_init(adns_state *ads_r, adns_initflags flags, FILE *diagfile) {
+int adns_init(adns_state *ads_r, int flags, FILE *diagfile) {
   adns_state ads;
   const char *res_options, *adns_res_options;
   int r;
@@ -531,11 +551,12 @@
   r= init_finish(ads);
   if (r) return r;
 
+  adns__consistency(ads,0,cc_entex);
   *ads_r= ads;
   return 0;
 }
 
-int adns_init_strcfg(adns_state *ads_r, adns_initflags flags,
+int adns_init_strcfg(adns_state *ads_r, int flags,
 		     FILE *diagfile, const char *configtext) {
   adns_state ads;
   int r;
@@ -550,11 +571,14 @@
   }
 
   r= init_finish(ads);  if (r) return r;
+  adns__consistency(ads,0,cc_entex);
   *ads_r= ads;
   return 0;
 }
 
+
 void adns_finish(adns_state ads) {
+  adns__consistency(ads,0,cc_entex);
   for (;;) {
     if (ads->timew.head) adns_cancel(ads->timew.head);
     else if (ads->childw.head) adns_cancel(ads->childw.head);
@@ -569,6 +593,7 @@
 }
 
 void adns_forallqueries_begin(adns_state ads) {
+  adns__consistency(ads,0,cc_entex);
   ads->forallnext=
     ads->timew.head ? ads->timew.head :
     ads->childw.head ? ads->childw.head :
@@ -578,6 +603,7 @@
 adns_query adns_forallqueries_next(adns_state ads, void **context_r) {
   adns_query qu, nqu;
 
+  adns__consistency(ads,0,cc_entex);
   nqu= ads->forallnext;
   for (;;) {
     qu= nqu;
Index: adns/src/transmit.c
diff -u adns/src/transmit.c:1.12 adns/src/transmit.c:1.14
--- adns/src/transmit.c:1.12	Thu Jul 29 23:16:13 1999
+++ adns/src/transmit.c	Sun Oct 10 14:16:24 1999
@@ -4,7 +4,12 @@
  * - send queries
  */
 /*
- *  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
  *  
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -22,7 +27,6 @@
  */
 
 #include <errno.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <sys/uio.h>
Index: adns/src/types.c
diff -u adns/src/types.c:1.31 adns/src/types.c:1.35
--- adns/src/types.c:1.31	Thu Jul 29 22:34:43 1999
+++ adns/src/types.c	Wed Oct 13 01:23:01 1999
@@ -3,7 +3,12 @@
  * - RR-type-specific code, and the machinery to call it
  */
 /*
- *  This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson
+ *  This file is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *
+ *  It is part of adns, which is
+ *    Copyright (C) 1997-1999 Ian Jackson <ian@davenant.greenend.org.uk>
+ *    Copyright (C) 1999 Tony Finch <dot@dotat.at>
  *  
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -21,7 +26,6 @@
  */
 
 #include <stdlib.h>
-#include <string.h>
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -71,11 +75,10 @@
  */
 
 /*
- * _string               (pap)
- * _textdata, _qstring   (csp)
+ * _qstring               (pap,csp)
  */
 
-static adns_status pap_string(const parseinfo *pai, int *cbyte_io, int max,
+static adns_status pap_qstring(const parseinfo *pai, int *cbyte_io, int max,
 			      int *len_r, char **str_r) {
   /* Neither len_r nor str_r may be null.
    * End of datagram (overrun) is indicated by returning adns_s_invaliddata;
@@ -103,7 +106,7 @@
   return adns_s_ok;
 }
 
-static adns_status csp_textdata(vbuf *vb, const char *dp, int len) {
+static adns_status csp_qstring(vbuf *vb, const char *dp, int len) {
   unsigned char ch;
   char buf[10];
   int cn;
@@ -111,10 +114,12 @@
   CSP_ADDSTR("\"");
   for (cn=0; cn<len; cn++) {
     ch= *dp++;
-    if (ch >= 32 && ch <= 126 && ch != '"' && ch != '\\') {
-      if (!adns__vbuf_append(vb,&ch,1)) R_NOMEM;
-    } else if (ch == '\\') {
+    if (ch == '\\') {
       CSP_ADDSTR("\\\\");
+    } else if (ch == '"') {
+      CSP_ADDSTR("\\\"");
+    } else if (ch >= 32 && ch <= 126) {
+      if (!adns__vbuf_append(vb,&ch,1)) R_NOMEM;
     } else {
       sprintf(buf,"\\x%02x",ch);
       CSP_ADDSTR(buf);
@@ -125,12 +130,8 @@
   return adns_s_ok;
 }
 
-static adns_status csp_qstring(vbuf *vb, const char *dp) {
-  return csp_textdata(vb, dp, strlen(dp));
-}
-
 /*
- * _str  (mf,cs)
+ * _str  (mf)
  */
 
 static void mf_str(adns_query qu, void *datap) {
@@ -139,14 +140,8 @@
   adns__makefinal_str(qu,rrp);
 }
 
-static adns_status cs_str(vbuf *vb, const void *datap) {
-  const char *const *rrp= datap;
-
-  return csp_qstring(vb,*rrp);
-}
-
 /*
- * _intstr  (mf,csp,cs)
+ * _intstr  (mf)
  */
 
 static void mf_intstr(adns_query qu, void *datap) {
@@ -155,22 +150,8 @@
   adns__makefinal_str(qu,&rrp->str);
 }
 
-static adns_status csp_intstr(vbuf *vb, const adns_rr_intstr *rrp) {
-  char buf[10];
-
-  sprintf(buf,"%u ",rrp->i);
-  CSP_ADDSTR(buf);
-  return csp_qstring(vb,rrp->str);
-}
-
-static adns_status cs_intstr(vbuf *vb, const void *datap) {
-  const adns_rr_intstr *rrp= datap;
-  
-  return csp_intstr(vb,rrp);
-}
-
 /*
- * _manyistr   (mf,cs)
+ * _manyistr   (mf)
  */
 
 static void mf_manyistr(adns_query qu, void *datap) {
@@ -187,21 +168,8 @@
     adns__makefinal_str(qu,&te->str);
 }
 
-static adns_status cs_manyistr(vbuf *vb, const void *datap) {
-  const adns_rr_intstr *const *rrp= datap;
-  const adns_rr_intstr *current;
-  adns_status st;
-  int spc;
-
-  for (spc=0, current= *rrp; current->i >= 0; current++) {
-    if (spc) CSP_ADDSTR(" ");
-    st= csp_textdata(vb,current->str,current->i); if (st) return st;
-  }
-  return adns_s_ok;
-}
-
 /*
- * _txt   (pa)
+ * _txt   (pa,cs)
  */
 
 static adns_status pa_txt(const parseinfo *pai, int cbyte, int max, void *datap) {
@@ -218,13 +186,13 @@
     cbyte+= l;
     tc++;
   }
-  if (cbyte != max) return adns_s_invaliddata;
+  if (cbyte != max || !tc) return adns_s_invaliddata;
 
   table= adns__alloc_interim(pai->qu,sizeof(*table)*(tc+1));
   if (!table) R_NOMEM;
 
   for (cbyte=startbyte, ti=0, te=table; ti<tc; ti++, te++) {
-    st= pap_string(pai, &cbyte, max, &te->i, &te->str);
+    st= pap_qstring(pai, &cbyte, max, &te->i, &te->str);
     if (st) return st;
   }
   assert(cbyte == max);
@@ -236,7 +204,34 @@
   return adns_s_ok;
 }
 
+static adns_status cs_txt(vbuf *vb, const void *datap) {
+  const adns_rr_intstr *const *rrp= datap;
+  const adns_rr_intstr *current;
+  adns_status st;
+  int spc;
+
+  for (current= *rrp, spc=0;  current->i >= 0;  current++, spc=1) {
+    if (spc) CSP_ADDSTR(" ");
+    st= csp_qstring(vb,current->str,current->i); if (st) return st;
+  }
+  return adns_s_ok;
+}
+
 /*
+ * _hinfo   (cs)
+ */
+
+static adns_status cs_hinfo(vbuf *vb, const void *datap) {
+  const adns_rr_intstrpair *rrp= datap;
+  adns_status st;
+
+  st= csp_qstring(vb,rrp->array[0].str,rrp->array[0].i);  if (st) return st;
+  CSP_ADDSTR(" ");
+  st= csp_qstring(vb,rrp->array[1].str,rrp->array[1].i);  if (st) return st;
+  return adns_s_ok;
+}
+
+/*
  * _inaddr   (pa,dip,di)
  */
 
@@ -318,7 +313,7 @@
 
   switch (rrp->addr.inet.sin_family) {
   case AF_INET:
-    CSP_ADDSTR("AF_INET ");
+    CSP_ADDSTR("INET ");
     ia= inet_ntoa(rrp->addr.inet.sin_addr); assert(ia);
     CSP_ADDSTR(ia);
     break;
@@ -337,7 +332,8 @@
 }
 
 /*
- * _domain  (pap)
+ * _domain      (pap,csp,cs)
+ * _dom_raw     (pa)
  */
 
 static adns_status pap_domain(const parseinfo *pai, int *cbyte_io, int max,
@@ -360,6 +356,28 @@
   return adns_s_ok;
 }
 
+static adns_status csp_domain(vbuf *vb, const char *domain) {
+  CSP_ADDSTR(domain);
+  if (!*domain) CSP_ADDSTR(".");
+  return adns_s_ok;
+}
+
+static adns_status cs_domain(vbuf *vb, const void *datap) {
+  const char *const *domainp= datap;
+  return csp_domain(vb,*domainp);
+}
+
+static adns_status pa_dom_raw(const parseinfo *pai, int cbyte, int max, void *datap) {
+  char **rrp= datap;
+  adns_status st;
+
+  st= pap_domain(pai, &cbyte, max, rrp, pdf_quoteok);
+  if (st) return st;
+  
+  if (cbyte != max) return adns_s_invaliddata;
+  return adns_s_ok;
+}
+
 /*
  * _host_raw   (pa)
  */
@@ -422,9 +440,11 @@
   adns_answer *cans= child->answer;
   adns_rr_hostaddr *rrp= child->ctx.info.hostaddr;
   adns_state ads= parent->ads;
+  adns_status st;
 
-  rrp->astatus= cans->status;
-  rrp->naddrs= cans->nrrs;
+  st= cans->status;
+  rrp->astatus= st;
+  rrp->naddrs= (st>0 && st<=adns_s_max_tempfail) ? -1 : cans->nrrs;
   rrp->addrs= cans->rrs.addr;
   adns__transfer_interim(child, parent, rrp->addrs, rrp->naddrs*sizeof(adns_rr_addr));
 
@@ -530,21 +550,34 @@
 }
 
 static adns_status csp_hostaddr(vbuf *vb, const adns_rr_hostaddr *rrp) {
-  const char *to_add;
+  const char *errstr;
   adns_status st;
+  char buf[20];
   int i;
 
-  st= csp_qstring(vb,rrp->host); if (st) return st;
+  st= csp_domain(vb,rrp->host);  if (st) return st;
 
-  if (rrp->astatus) {
-    CSP_ADDSTR(" - ");
-    CSP_ADDSTR(adns_strerror(rrp->astatus));
-  } else {
-    assert(rrp->naddrs > 0);
-    for (i=0, to_add= ": "; i<rrp->naddrs; i++, to_add= ", ") {
-      CSP_ADDSTR(to_add);
+  CSP_ADDSTR(" ");
+  CSP_ADDSTR(adns_errtypeabbrev(rrp->astatus));
+
+  sprintf(buf," %d ",rrp->astatus);
+  CSP_ADDSTR(buf);
+
+  CSP_ADDSTR(adns_errabbrev(rrp->astatus));
+  CSP_ADDSTR(" ");
+
+  errstr= adns_strerror(rrp->astatus);
+  st= csp_qstring(vb,errstr,strlen(errstr));  if (st) return st;
+  
+  if (rrp->naddrs >= 0) {
+    CSP_ADDSTR(" (");
+    for (i=0; i<rrp->naddrs; i++) {
+      CSP_ADDSTR(" ");
       st= csp_addr(vb,&rrp->addrs[i]);
     }
+    CSP_ADDSTR(" )");
+  } else {
+    CSP_ADDSTR(" ?");
   }
   return adns_s_ok;
 }
@@ -633,6 +666,19 @@
 }
 
 /*
+ * _inthost  (cs)
+ */
+
+static adns_status cs_inthost(vbuf *vb, const void *datap) {
+  const adns_rr_intstr *rrp= datap;
+  char buf[10];
+
+  sprintf(buf,"%u ",rrp->i);
+  CSP_ADDSTR(buf);
+  return csp_domain(vb,rrp->str);
+}
+
+/*
  * _ptr   (pa, +icb_ptr)
  */
 
@@ -735,7 +781,7 @@
 }
 
 /*
- * _strpair   (mf,cs)
+ * _strpair   (mf)
  */
 
 static void mf_strpair(adns_query qu, void *datap) {
@@ -745,19 +791,8 @@
   adns__makefinal_str(qu,&rrp->array[1]);
 }
 
-static adns_status cs_strpair(vbuf *vb, const void *datap) {
-  const adns_rr_strpair *rrp= datap;
-  adns_status st;
-
-  st= csp_qstring(vb,rrp->array[0]);  if (st) return st;
-  CSP_ADDSTR(" ");
-  st= csp_qstring(vb,rrp->array[1]);  if (st) return st;
-
-  return adns_s_ok;
-}
-
 /*
- * _intstrpair   (mf,cs)
+ * _intstrpair   (mf)
  */
 
 static void mf_intstrpair(adns_query qu, void *datap) {
@@ -767,17 +802,6 @@
   adns__makefinal_str(qu,&rrp->array[1].str);
 }
 
-static adns_status cs_intstrpair(vbuf *vb, const void *datap) {
-  const adns_rr_intstrpair *rrp= datap;
-  adns_status st;
-
-  st= csp_intstr(vb,&rrp->array[0]);  if (st) return st;
-  CSP_ADDSTR(" ");
-  st= csp_intstr(vb,&rrp->array[1]);  if (st) return st;
-
-  return adns_s_ok;
-}
-
 /*
  * _hinfo   (pa)
  */
@@ -788,7 +812,7 @@
   int i;
 
   for (i=0; i<2; i++) {
-    st= pap_string(pai, &cbyte, max, &rrp->array[i].i, &rrp->array[i].str);
+    st= pap_qstring(pai, &cbyte, max, &rrp->array[i].i, &rrp->array[i].str);
     if (st) return st;
   }
 
@@ -798,7 +822,7 @@
 }
 
 /*
- * _mailbox   (pap)
+ * _mailbox   (pap,cs)
  */
 
 static adns_status pap_mailbox822(const parseinfo *pai, int *cbyte_io, int max,
@@ -818,7 +842,7 @@
 			*cbyte_io, cbyte_io);
   st= adns__findlabel_next(&fls,&lablen,&labstart);
   if (!lablen) {
-    adns__vbuf_appendstr(vb,"<>");
+    adns__vbuf_appendstr(vb,".");
     goto x_ok;
   }
 
@@ -827,7 +851,7 @@
     c= *p++;
     if ((c&~128) < 32 || (c&~128) == 127) return adns_s_invaliddata;
     if (c == '.' && !neednorm) neednorm= 1;
-    else if (strchr("()<>@,;:\\\".[]",c)) needquote++;
+    else if (c==' ' || ctype_822special(c)) needquote++;
     else neednorm= 0;
   }
 
@@ -836,7 +860,7 @@
     adns__vbuf_appendq(vb,"\"",1);
     for (i=0, needquote=0, p= pai->dgram+labstart; i<lablen; i++, p++) {
       c= *p;
-      if (strchr("()<>@,;:\\\".[]",c)) adns__vbuf_appendq(vb,"\\",1);
+      if (c == '"' || c=='\\') adns__vbuf_appendq(vb,"\\",1);
       adns__vbuf_appendq(vb,p,1);
     }
     adns__vbuf_appendq(vb,"\"",1);
@@ -862,13 +886,16 @@
   if (pai->qu->typei->type & adns__qtf_mail822) {
     return pap_mailbox822(pai, cbyte_io, max, mb_r);
   } else {
-    return pap_domain(pai, cbyte_io, max, mb_r,
-		      pai->qu->flags & adns_qf_quoteok_anshost ? pdf_quoteok : 0);
+    return pap_domain(pai, cbyte_io, max, mb_r, pdf_quoteok);
   }
 }
 
+static adns_status csp_mailbox(vbuf *vb, const char *mailbox) {
+  return csp_domain(vb,mailbox);
+}
+
 /*
- * _rp   (pa)
+ * _rp   (pa,cs)
  */
 
 static adns_status pa_rp(const parseinfo *pai, int cbyte, int max, void *datap) {
@@ -885,6 +912,17 @@
   return adns_s_ok;
 }
 
+static adns_status cs_rp(vbuf *vb, const void *datap) {
+  const adns_rr_strpair *rrp= datap;
+  adns_status st;
+
+  st= csp_mailbox(vb,rrp->array[0]);  if (st) return st;
+  CSP_ADDSTR(" ");
+  st= csp_domain(vb,rrp->array[1]);  if (st) return st;
+
+  return adns_s_ok;
+}  
+
 /*
  * _soa   (pa,mf,cs)
  */
@@ -926,9 +964,9 @@
   int i;
   adns_status st;
   
-  st= csp_qstring(vb,rrp->mname);  if (st) return st;
+  st= csp_domain(vb,rrp->mname);  if (st) return st;
   CSP_ADDSTR(" ");
-  st= csp_qstring(vb,rrp->rname);  if (st) return st;
+  st= csp_mailbox(vb,rrp->rname);  if (st) return st;
 
   for (i=0; i<5; i++) {
     sprintf(buf," %lu",(&rrp->serial)[i]);
@@ -953,32 +991,32 @@
 #define DEEP_MEMB(memb) TYPESZ_M(memb), mf_##memb, cs_##memb
 #define FLAT_MEMB(memb) TYPESZ_M(memb), mf_flat, cs_##memb
 
-#define DEEP_TYPE(code,rrt,fmt,memb,parser,comparer) \
- { adns_r_##code, rrt, fmt, TYPESZ_M(memb), mf_##memb, cs_##memb, parser, comparer }
-#define FLAT_TYPE(code,rrt,fmt,memb,parser,comparer) \
- { adns_r_##code, rrt, fmt, TYPESZ_M(memb), mf_flat, cs_##memb, parser, comparer }
+#define DEEP_TYPE(code,rrt,fmt,memb,parser,comparer,printer) \
+ { adns_r_##code, rrt, fmt, TYPESZ_M(memb), mf_##memb, printer, parser, comparer }
+#define FLAT_TYPE(code,rrt,fmt,memb,parser,comparer,printer) \
+ { adns_r_##code, rrt, fmt, TYPESZ_M(memb), mf_flat, printer, parser, comparer }
 
 static const typeinfo typeinfos[] = {
 /* Must be in ascending order of rrtype ! */
-/* mem-mgmt code     rrt     fmt      member       parser        comparer    */
-  							     
-  FLAT_TYPE(a,       "A",     0,      inaddr,      pa_inaddr,    di_inaddr   ),
-  DEEP_TYPE(ns_raw,  "NS",   "raw",   str,         pa_host_raw,  0           ),
-  DEEP_TYPE(cname,   "CNAME", 0,      str,         pa_host_raw,  0           ),
-  DEEP_TYPE(soa_raw, "SOA",  "raw",   soa,         pa_soa,       0           ),
-  DEEP_TYPE(ptr_raw, "PTR",  "raw",   str,         pa_host_raw,  0           ),
-  DEEP_TYPE(hinfo,   "HINFO", 0,      intstrpair,  pa_hinfo,     0           ),
-  DEEP_TYPE(mx_raw,  "MX",   "raw",   intstr,      pa_mx_raw,    di_mx_raw   ),
-  DEEP_TYPE(txt,     "TXT",   0,      manyistr,    pa_txt,       0           ),
-  DEEP_TYPE(rp_raw,  "RP",   "raw",   strpair,     pa_rp,        0           ),
-   		      	                                     		  	     
-  FLAT_TYPE(addr,    "A",  "addr",    addr,        pa_addr,      di_addr     ),
-  DEEP_TYPE(ns,      "NS", "+addr",   hostaddr,    pa_hostaddr,  di_hostaddr ),
-  DEEP_TYPE(ptr,     "PTR","checked", str,         pa_ptr,       0           ),
-  DEEP_TYPE(mx,      "MX", "+addr",   inthostaddr, pa_mx,        di_mx       ),
-   		      	                                  		   
-  DEEP_TYPE(soa,     "SOA","822",     soa,         pa_soa,       0           ),
-  DEEP_TYPE(rp,      "RP", "822",     strpair,     pa_rp,        0           ),
+/* mem-mgmt code  rrt     fmt     member      parser      comparer    printer       */
+  		    		     		 	     		 	       
+FLAT_TYPE(a,      "A",     0,     inaddr,     pa_inaddr,  di_inaddr,  cs_inaddr     ),
+DEEP_TYPE(ns_raw, "NS",   "raw",  str,        pa_host_raw,0,          cs_domain     ),
+DEEP_TYPE(cname,  "CNAME", 0,     str,        pa_dom_raw, 0,          cs_domain     ),
+DEEP_TYPE(soa_raw,"SOA",  "raw",  soa,        pa_soa,     0,          cs_soa        ),
+DEEP_TYPE(ptr_raw,"PTR",  "raw",  str,        pa_host_raw,0,          cs_domain     ),
+DEEP_TYPE(hinfo,  "HINFO", 0,     intstrpair, pa_hinfo,   0,          cs_hinfo      ),
+DEEP_TYPE(mx_raw, "MX",   "raw",  intstr,     pa_mx_raw,  di_mx_raw,  cs_inthost    ),
+DEEP_TYPE(txt,    "TXT",   0,     manyistr,   pa_txt,     0,          cs_txt        ),
+DEEP_TYPE(rp_raw, "RP",   "raw",  strpair,    pa_rp,      0,          cs_rp         ),
+ 		     	                                     		   	       
+FLAT_TYPE(addr,   "A",  "addr",   addr,       pa_addr,    di_addr,    cs_addr       ),
+DEEP_TYPE(ns,     "NS", "+addr",  hostaddr,   pa_hostaddr,di_hostaddr,cs_hostaddr   ),
+DEEP_TYPE(ptr,    "PTR","checked",str,        pa_ptr,     0,          cs_domain     ),
+DEEP_TYPE(mx,     "MX", "+addr",  inthostaddr,pa_mx,      di_mx,      cs_inthostaddr),
+ 		     	                                     		      
+DEEP_TYPE(soa,    "SOA","822",    soa,        pa_soa,     0,          cs_soa        ),
+DEEP_TYPE(rp,     "RP", "822",    strpair,    pa_rp,      0,          cs_rp         ),
 };
 
 const typeinfo *adns__findtype(adns_rrtype type) {
