"host" Return Codes

Barry Finkel b19141 at achilles.ctd.anl.gov
Fri May 18 18:32:43 UTC 2007


I have a question about the: "host" command - specifically the return 
code.  Here is the output of two executions - one on Solaris 10 and
the other on Ubuntu:

     atalanta% uname -a
     SunOS atalanta.it.anl.gov 5.10 Generic_125100-05 sun4u sparc
           SUNW,Sun-Fire-V240
     atalanta% host aaa.anl.gov
     Host aaa.anl.gov not found: 3(NXDOMAIN)
     atalanta% echo $status
     0
     atalanta% which host  
     /usr/sbin/host
     atalanta%


     vm20% uname -a
     Linux vm20.it.anl.gov 2.6.15-28-amd64-k8 #1 SMP PREEMPT
           Tue Mar 13 20:57:54 UTC 2007 x86_64 GNU/Linux
     vm20% host aaa.anl.gov
     Host aaa.anl.gov not found: 3(NXDOMAIN)
     vm20% echo $status
     1
     vm20% which host
     /usr/bin/host
     vm20%

Note that Solaris 10 gives a return code of 0, while Ubuntu gives an
expected return code of 1.  I did not see anything in the BIND 9.3.4
CHANGES file about host and return codes.  I do not see any string
within the host executable that tells me the origin of the source.

     atalanta% strings /usr/sbin/host | grep '[0-9]'
     RESERVED3
     RESERVED6
     RESERVED7
     RESERVED8
     RESERVED9
     RESERVED10
     RESERVED11
     RESERVED12
     RESERVED13
     RESERVED14
     RESERVED15
     RESERVED11
     RESERVED12
     RESERVED13
     RESERVED14
     RESERVED15
     x25 address
     has v6 address
     has 42 record
     has 43 record
     has 44 record
     has 45 record
     has 46 record
     has 47 record
     has 48 record
     has 49 record
     has 50 record
     has 51 record
     has 52 record
     has 53 record
     has 54 record
     has 55 record
     has 56 record
     has 57 record
     has 58 record
     has 59 record
     has 60 record
     has 61 record
     has 62 record
     has 63 record
     has 64 record
     has 65 record
     has 66 record
     has 67 record
     has 68 record
     has 69 record
     has 70 record
     has 71 record
     has 72 record
     has 73 record
     has 74 record
     has 75 record
     has 76 record
     has 77 record
     has 78 record
     has 79 record
     has 80 record
     has 81 record
     has 82 record
     has 83 record
     has 84 record
     has 85 record
     has 86 record
     has 87 record
     has 88 record
     has 89 record
     has 90 record
     has 91 record
     has 92 record
     has 93 record
     has 94 record
     has 95 record
     has 96 record
     has 97 record
     has 98 record
     has 99 record
	    -i Use the old IN6.INT form of IPv6 reverse lookup
     %02x 
     servname != 0
     looknew != 0
     looknew != 0
     127.0.0.1
     can't find either v4 or v6 networking
     sockcount == 0
     recvcount == 0
     query != 0
     query->recvspace != 0
     lookup != 0
     current_lookup == 0
     lookup != 0
     event->ev_type == (((2) << 16) + 2)
     sendcount >= 0
     query->sock == 0
     query->sock != 0
     event->ev_type == (((1) << 16) + 2)
     event->ev_type == (((2) << 16) + 1)
     recvcount >= 0
     sockcount >= 0
     (((query->recvlist).head == 0) ? isc_boolean_true : isc_boolean_false)
     sockcount >= 0
     event->ev_type == (((2) << 16) + 4)
     sockcount >= 0
     sockcount >= 0
     recvcount >= 0
     event->ev_type == (((2) << 16) + 1)
     sockcount >= 0
     Protocol family INET6 not supported '%s'
     lookup != 0
     sockcount == 0
     recvcount == 0
     sendcount == 0
     ((lookup_list).head) == 0
     current_lookup == 0
     ((pthread_mutex_destroy(((&lookup_lock))) == 0) ? 0 : 34) == 0
     atalanta%

     vm20% strings /usr/bin/host | grep '[0-9]'
     /lib64/ld-linux-x86-64.so.2
     liblwres.so.9
     libdns.so.21
     isc__buffer_putuint16
     dns_byaddr_createptrname2
     isc_buffer_getuint16
     dns_tsig_hmacmd5_name
     isc_sockaddr_any6
     libcrypto.so.0.9.8
     libbind9.so.0
     isc_net_probeipv6
     isc_net_probeipv4
     bind9_getaddresses
     libisc.so.11
     isc_base64_decodestring
     isc_net_disableipv4
     isc_net_disableipv6
     libisccfg.so.1
     libnsl.so.1
     libpthread.so.0
     libc.so.6
     have_ipv4
     have_ipv6
     GLIBC_2.2.5
     t$4L
     t$4H
     t$4H
     |$8H
     L$H1
     t$4H
     D$$1
     AWE1
     L$8H
     L$8L
     []A\1
     t$@E1
     L$ 1
     L$ 1
     T$0E
     t7[H
     t$8H
     D$8H
     t$8L
     t$8A
     |$0H
     D$(1
     x25 address
     has IPv6 address
     RESERVED3
     RESERVED6
     RESERVED7
     RESERVED8
     RESERVED9
     RESERVED10
     RESERVED11
     RESERVED12
     RESERVED13
     RESERVED14
     RESERVED15
     isc_time_now((&now)) == 0
     can't find IPv4 networking
     can't find IPv6 networking
     lvwrdt:c:aTCN:R:W:Dni46
	    -i IP6.INT reverse lookups
	    -4 use IPv4 query transport only
	    -6 use IPv6 query transport only
     servname != ((void *)0)
     looknew != ((void *)0)
     127.0.0.1
     sockcount == 0
     recvcount == 0
     query != ((void *)0)
     lookup != ((void *)0)
     sendcount >= 0
     count == 1
     query->sock != ((void *)0)
     current_lookup == ((void *)0)
     query->sock == ((void *)0)
     sockcount >= 0
     recvcount >= 0
     %02x 
     sendcount == 0
     can't find either v4 or v6 networking
     query->recvspace != ((void *)0)
     event->ev_type == (((2) << 16) + 2)
     isc_time_now((&query->time_sent)) == 0
     event->ev_type == (((2) << 16) + 4)
     event->ev_type == (((2) << 16) + 1)
     (((query->recvlist).head == ((void *)0)) ? isc_boolean_true : isc_boolean_false)
     event->ev_type == (((1) << 16) + 2)
     ((lookup_list).head) == ((void *)0)
     ((pthread_mutex_destroy(((&lookup_lock))) == 0) ? 0 : 34) == 0
     vm20% 



More information about the bind-users mailing list