Subject: pkg/12056: a package for 'host-991529', the best command-line DNS query & test tool
To: None <gnats-bugs@gnats.netbsd.org>
From: None <woods@proven.weird.com>
List: netbsd-bugs
Date: 01/27/2001 13:29:20
>Number: 12056
>Category: pkg
>Synopsis: a package for 'host-991529', the best command-line DNS query & test tool
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sat Jan 27 13:32:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Greg A. Woods
>Release: pkgsrc-2001/01/27
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:
>Description:
since it seems neither the BIND-8 distribution nor NetBSD are
going to update their integrated versions of 'host' here is a
package for the newest version....
>How-To-Repeat:
try to use 'host -C microsoft.com' with the BIND-8.2.3 or NetBSD
version and find that all it does is spit out a usage error....
>Fix:
install the following module into pkgsrc/net/host
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# Makefile
# files
# patches
# pkg
# files/md5
# files/patch-sum
# patches/patch-netbsd
# pkg/COMMENT
# pkg/DESCR
# pkg/PLIST
#
echo x - Makefile
sed 's/^X//' >Makefile << 'END-of-Makefile'
X# $NetBSD$
X
XDISTNAME= host_991529
XPKGNAME= host-991529
XCATEGORIES= net
XMASTER_SITES= ftp://ftp.nikhef.nl/pub/network/
XEXTRACT_SUFX= .tar.Z
X
XMAINTAINER= packages@netbsd.org
XHOMEPAGE= http://www.nikhef.nl/user/e07/
X
X.include "../../mk/bsd.prefs.mk"
X
X# If you've removed $HOSTALIASES support from your system then
X# you won't have the hostalias() function in libc....
X.if !defined(NO_HOSTALIASES)
XMAKE_ENV+= ALLOW_HOSTALIASES=-DALLOW_HOSTALIASES
X.endif
X
XNO_CONFIGURE= yes
XNO_WRKSUBDIR= yes
X
X# MAKE_ENV will have the right effect...
XMAKEFLAGS+= -e
X
Xpost-build:
X ${SED} -e 's,@PREFIX@,${PREFIX},g' ${WRKSRC}/mxlookup > ${WRKDIR}/mxlookup.out
X ${SED} -e 's,@PREFIX@,${PREFIX},g' ${WRKSRC}/rblookup > ${WRKDIR}/rblookup.out
X
Xpost-install:
X ${INSTALL_SCRIPT} ${WRKDIR}/mxlookup.out ${PREFIX}/bin/mxlookup
X ${INSTALL_SCRIPT} ${WRKDIR}/rblookup.out ${PREFIX}/bin/rblookup
X ${INSTALL_MAN} ${WRKDIR}/host.1 ${PREFIX}/man/man1/host.1
X
X.include "../../mk/bsd.pkg.mk"
END-of-Makefile
echo c - files
mkdir -p files > /dev/null 2>&1
echo c - patches
mkdir -p patches > /dev/null 2>&1
echo c - pkg
mkdir -p pkg > /dev/null 2>&1
echo x - files/md5
sed 's/^X//' >files/md5 << 'END-of-files/md5'
X$NetBSD$
X
XMD5 (host_991529.tar.Z) = f3c5589cbe168a49581e856fe26b4808
END-of-files/md5
echo x - files/patch-sum
sed 's/^X//' >files/patch-sum << 'END-of-files/patch-sum'
X$NetBSD$
X
XMD5 (patch-netbsd) = 5a5a7bc7ce781c63dc9f1722abc8c332
END-of-files/patch-sum
echo x - patches/patch-netbsd
sed 's/^X//' >patches/patch-netbsd << 'END-of-patches/patch-netbsd'
Xcvs diff: Diffing .
Xcvs diff: tag 1.1.1 is not in file .cvsignore
XIndex: Makefile
X===================================================================
XRCS file: /cvs/misc/host/Makefile,v
Xretrieving revision 1.1.1.8
Xdiff -u -r1.1.1.8 Makefile
X+++ Makefile 2001/01/27 20:17:02
X@@ -4,11 +4,13 @@
X # Adapt the installation directories to your local standards.
X # ----------------------------------------------------------------------
X
X+PREFIX = /usr/local
X+
X # This is where the host executable will go.
X-DESTBIN = /usr/local/bin
X+DESTBIN = ${PREFIX}/bin
X
X # This is where the host manual page will go.
X-DESTMAN = /usr/local/man
X+DESTMAN = ${PREFIX}/man
X
X BINDIR = $(DESTBIN)
X MANDIR = $(DESTMAN)/man1
X@@ -37,8 +39,11 @@
X #if defined(solaris) && You are using its default broken resolver library
X SYSDEFS = -DNO_YP_LOOKUP
X #endif
X+
X+SYSDEFS =
X
X-SYSDEFS =
X+#if defined(NetBSD) && you have not removed support for $HOSTALIASES
X+SYSDEFS = ${ALLOW_HOSTALIASES}
X
X # ----------------------------------------------------------------------
X # Configuration definitions.
X@@ -58,6 +63,7 @@
X #endif
X
X # This is the default in either case if you compile stand-alone.
X+CONFIGDEFS = -DBIND_RES_SEND
X CONFIGDEFS = -DHOST_RES_SEND
X
X # ----------------------------------------------------------------------
X@@ -68,6 +74,7 @@
X
X INCL = ../../include
X INCL = .
X+#INCL = /usr/local/bind/include
X
X COMPINCL = ../../compat/include
X COMPINCL = .
X@@ -111,6 +118,7 @@
X RES =
X RES = ../../res/libresolv.a
X RES = -lresolv
X+#RES = -L/usr/local/bind/lib -lbind
X
X COMPLIB = ../../compat/lib/lib44bsd.a
X COMPLIB = -lnet
X@@ -171,10 +179,10 @@
X # Rules for installation.
X # ----------------------------------------------------------------------
X
X-OWNER = root
X-GROUP = staff
X-MODE = 755
X-STRIP = -s
X+BINOWN = root
X+BINGRP = staff
X+BINMODE = 755
X+STRIPFLAG = -s
X
X all: $(PROG)
X
X@@ -184,7 +192,7 @@
X $(CC) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBRARIES)
X
X install: $(PROG)
X- $(INSTALL) -m $(MODE) -o $(OWNER) -g $(GROUP) $(STRIP) $(PROG) $(BINDIR)
X+ $(INSTALL) -m $(BINMODE) -o $(BINOWN) -g $(BINGRP) $(STRIPFLAG) $(PROG) $(BINDIR)
X
X man: $(MANS)
X $(INSTALL) -m 444 host.1 $(MANDIR)
Xcvs diff: host.c no longer exists, no comparison available
XIndex: info.c
X===================================================================
XRCS file: /cvs/misc/host/info.c,v
Xretrieving revision 1.1.1.2
Xdiff -u -r1.1.1.2 info.c
X+++ info.c 2001/01/27 19:08:35
X@@ -85,6 +85,7 @@
X if (*cp == '.')
X dot++;
X
X+#ifdef ALLOW_HOSTALIASES
X /*
X * Check for aliases of single name.
X * Note that the alias is supposed to be fully qualified.
X@@ -97,6 +98,7 @@
X result = get_domaininfo(cp, (char *)NULL);
X return(result);
X }
X+#endif
X
X /*
X * Trailing dot means absolute (fully qualified) address.
XIndex: mxlookup
X===================================================================
XRCS file: /cvs/misc/host/mxlookup,v
Xretrieving revision 1.1.1.1
Xdiff -u -r1.1.1.1 mxlookup
X+++ mxlookup 2001/01/27 19:12:32
X@@ -26,10 +26,12 @@
X # Setup environment.
X # ----------------------------------------------------------------------
X
X-# This is where the ``host'' executable lives.
X-BINDIR=/usr/local/bin
X+# This is where the ``host'' executable lives. (should not be needed
X+# on NetBSD or anywhere where the old ``host'' has been erradicated
X+# and the new one is in the standard path, but that is not yet so...)
X+BINDIR=@PREFIX@/bin
X
X+PATH=${BINDIR}:/bin:/usr/bin ; export PATH
X
X cmd=`basename $0`
X
XIndex: rblookup
X===================================================================
XRCS file: /cvs/misc/host/rblookup,v
Xretrieving revision 1.1.1.2
Xdiff -u -r1.1.1.2 rblookup
X+++ rblookup 2001/01/27 19:54:11
X@@ -12,8 +12,8 @@
X # of the Mail Abuse Prevention System. See: http://maps.vix.com/rbl
X #
X # Syntax:
X-# rblookup hostname
X-# rblookup -i dottedquad
X+# rblookup hostname ...
X+# rblookup -i dottedquad ...
X #
X # Returns:
X # zero if the given host was found on the blacklist.
X@@ -44,25 +44,74 @@
X # Setup environment.
X # ----------------------------------------------------------------------
X
X-# This is where the ``host'' executable lives.
X-BINDIR=/usr/local/bin
X+# This is where the ``host'' executable lives. (should not be needed
X+# on NetBSD or anywhere where the old ``host'' has been erradicated
X+# and the new one is in the standard path, but that is not yet so...)
X+BINDIR=@PREFIX@/bin
X
X+PATH=${BINDIR}:/bin:/usr/bin ; export PATH
X
X cmd=`basename $0`
X
X-options="[-maps] [-orbs] [-i] [-v]"
X+options="[-dul] [-maps] [-orbs] [-relays] [-i] [-v]"
X+usage="Usage: $cmd $options hostname|IP# ..."
X
X # ----------------------------------------------------------------------
X-# Configuration.
X+# RBLs:
X # ----------------------------------------------------------------------
X
X-MAPSROOT="rbl.maps.vix.com"
X+# MAPS RBL: Mail Abuse Protection System Realtime Blackhole List
X+# <URL:http://mail-abuse.org/rbl/>
X+#
X+# This listing is human-operated, and is one of the most popular
X+# blacklists of spam-originating systems. Originally started by Paul
X+# Vixie, this is the original "RBL" system.
X+#
X+MAPSROOT="blackholes.mail-abuse.org"
X+ALLRBLS="${MAPSROOT} ${ALLRBLS}"
X+
X+# MAPS DUL: Mail Abuse Protection System Dial-up User List
X+# <URL:http://mail-abuse.org/dul/>
X+#
X+# This list was started from a list compiled by "Afterburner" (the
X+# head-honcho abuse guy at Erols Internet), and extended to be easily
X+# added to over time. This service was originally called the ORCA
X+# DUL, and was operated at "dul.orca.bc.ca". The MAPS project invited
X+# Al Iverson, the then-current DUL maintainer, to host it on their
X+# systems.
X+#
X+DULROOT="dialups.mail-abuse.org"
X+ALLRBLS="${DULROOT} ${ALLRBLS}"
X+
X+# ORBS: Open Relay Behaviour-modification System
X+# <URL:http://www.orbs.org/>
X+#
X+# This is an listing of IP addresses that have been submitted by spam
X+# victims and others and have been automatically tested and proven to
X+# be the output ports of SMTP servers that will transmit at least one
X+# message to any system for anyone (an "open email relay").
X+# Administrators of listed servers can request re-testing and
X+# automated systems will remove those that have proven to close their
X+# relays. Input points of multi-level relays can be submitted too,
X+# but only the output point is listed in the DNS RBL.
X+#
X ORBSROOT="relays.orbs.org"
X+ALLRBLS="${ORBSROOT} ${ALLRBLS}"
X+
X+# RSS: MAPS Relay Spam Stopper
X+# <URL:http://mail-abuse.org/rss/>
X+#
X+# This is a list of e-mail relays which have been verified to have
X+# been used to send spam. They supposedly have archives of the spam
X+# they received through these relays. They do not list multi-level
X+# relays (and thus miss a vast number of the actively exploited
X+# systems out there -- I really hope they change this policy)!
X+#
X+RELAYSROOT="relays.mail-abuse.org"
X+ALLRBLS="${RELAYSROOT} ${ALLRBLS}"
X
X # ----------------------------------------------------------------------
X-# Exit codes from <sysexits.h>
X+# Exit codes from <sysexits.h>, just in case we are called from a mailer
X # ----------------------------------------------------------------------
X
X EX_OK=0
X@@ -85,8 +134,11 @@
X # ----------------------------------------------------------------------
X
X verbose=
X-reverse=
X-orbs=
X+reverse=false
X+orbs=false
X+dul=false
X+maps=false
X+relays=false
X
X skip=
X for i
X@@ -95,7 +147,9 @@
X
X case "$i" in
X -orbs) orbs=true ;;
X- -maps) orbs= ;;
X+ -dul) dul=true ;;
X+ -maps) maps=true ;;
X+ -relays) relays=true ;;
X -i) reverse=true ;;
X -v) verbose="-v" ;;
X -d) exec=echo ;;
X@@ -104,29 +158,11 @@
X esac
X shift
X done
X-
X-# ----------------------------------------------------------------------
X-# Process arguments.
X-# ----------------------------------------------------------------------
X
X-name="$1"
X+[ $# -lt 1 ] && fatal "$usage"
X
X-[ "X$name" = "X" ] && fatal "$usage"
X-
X-# Remove trailing dots.
X-name=`echo $name | sed 's/\.*$//'`
X-
X-if [ $reverse ]
X-then
X- # Assume this is already a dotted quad.
X- addresslist="$name"
X-else
X- # Try to resolve domain name into dotted quad.
X- addresslist=`host "$name" | awk '$2 == "A" {print $3}'`
X-fi
X-
X # ----------------------------------------------------------------------
X-# Auxiliary routines.
X+# More routines.
X # ----------------------------------------------------------------------
X
X invalid ()
X@@ -180,20 +216,42 @@
X
X exitstat=$EX_UNAVAILABLE
X
X-for address in $addresslist
X+for name in ${1+$@}
X do
X+ # Remove trailing dots.
X+ name=`echo $name | sed 's/\.*$//'`
X+
X+ if $reverse
X+ then
X+ # Assume this is already a dotted quad.
X+ address="$name"
X+ else
X+ # Try to resolve domain name into dotted quad.
X+ address=`host "$name" | awk '$2 == "A" {print $3}'`
X+ fi
X+
X # Swap dotted quad labels.
X invert
X
X- # Construct proper name in map.
X- [ $orbs ] && map="$ORBSROOT" || map="$MAPSROOT"
X- name="$reversed.$map"
X-
X- echo "--- $name ---"
X- $exec host $verbose -t A $name
X- found=$?
X- [ $found -eq $EX_OK ] && exitstat=$EX_OK
X- [ $found -eq $EX_OK ] && $exec host $verbose -t TXT $name
X+ rbllist=""
X+ $orbs && rbllist="$ORBSROOT $rbllist"
X+ $dul && rbllist="$DULROOT $rbllist"
X+ $maps && rbllist="$MAPSROOT $rbllist"
X+ $relays && rbllist="$RELAYSROOT $rbllist"
X+
X+ [ -z "$rbllist" ] && rbllist="$ALLRBLS"
X+
X+ for rbl in $rbllist
X+ do
X+ # Construct proper name in map.
X+ name="$reversed.$rbl"
X+
X+ echo "--- $name ---"
X+ $exec host $verbose -t A $name
X+ found=$?
X+ [ $found -eq $EX_OK ] && exitstat=$EX_OK
X+ [ $found -eq $EX_OK ] && $exec host $verbose -t TXT $name
X+ done
X done
X
X exit $exitstat
END-of-patches/patch-netbsd
echo x - pkg/COMMENT
sed 's/^X//' >pkg/COMMENT << 'END-of-pkg/COMMENT'
XHost is a very powerful DNS query and testing tool
END-of-pkg/COMMENT
echo x - pkg/DESCR
sed 's/^X//' >pkg/DESCR << 'END-of-pkg/DESCR'
XHost is a very powerful DNS query and testing command-line tool.
X
XMajor differences with the ancient version of the program with the same
Xname that's included in the BIND-4 and BIND-8 distributions:
X
X - Major overhaul of the entire code.
X - Very rigid error checking, with more verbose error messages.
X - Zone listing section completely rewritten.
X - It is now possible to do recursive listings into delegated zones.
X - Maintain resource record statistics during zone listings.
X - Maintain count of hosts during zone listings.
X - Check for various extraneous conditions during zone listings.
X - Check for illegal domain names containing invalid characters.
X - Verify that certain domain names represent canonical host names.
X - Perform ttl consistency checking during zone listings.
X - Exploit multiple server addresses if available.
X - Option to exploit only primary server for zone transfers.
X - Option to exclude info from names that do not reside in a zone.
X - Implement timeout handling during connect and read.
X - Write resource record output to optional log file.
X - Special MB tracing by recursively expanding MR and MG records.
X - Special mode to check SOA records at each nameserver for a zone.
X - Special mode to check reverse mappings of host addresses.
X - Extended syntax allows multiple arguments on command line or stdin.
X - Configurable default options in HOST_DEFAULTS environment variable.
X - Implement new resource record types from RFC 1183 and 1348.
X - Basic experimental NSAP support as defined in RFC 1637.
X - Implement new resource record types from RFC 1664 and 1712.
X - Implement new resource record types from RFC 1876 and 1886.
X - Code is extensively documented.
END-of-pkg/DESCR
echo x - pkg/PLIST
sed 's/^X//' >pkg/PLIST << 'END-of-pkg/PLIST'
X@comment $NetBSD$
Xbin/host
Xbin/mxlookup
Xbin/rblookup
Xman/man1/host.1
END-of-pkg/PLIST
exit
>Release-Note:
>Audit-Trail:
>Unformatted: