From pst@base.jnx.com  Thu Jul 18 17:57:05 1996
Received: from red.jnx.com (ppp-2-14.sntc01.pacbell.net [206.170.2.14])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id RAA04986
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 18 Jul 1996 17:57:04 -0700 (PDT)
Received: from base.jnx.com (base.jnx.com [208.197.169.238]) by red.jnx.com (8.7.5/8.7.3) with ESMTP id RAA19693 for <FreeBSD-gnats-submit@freebsd.org>; Thu, 18 Jul 1996 17:57:02 -0700 (PDT)
Received: (from pst@localhost) by base.jnx.com (8.7.5/8.7.3) id RAA00383; Thu, 18 Jul 1996 17:58:06 -0700 (PDT)
Message-Id: <199607190058.RAA00383@base.jnx.com>
Date: Thu, 18 Jul 1996 17:58:06 -0700 (PDT)
From: Paul Traina <pst@jnx.com>
Reply-To: pst@jnx.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: getnetbyname() for DNS network resolution is violently broken
X-Send-Pr-Version: 3.2

>Number:         1400
>Category:       bin
>Synopsis:       libc/net/getnetbydns.c needs an enema
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 18 18:00:01 PDT 1996
>Closed-Date:    Fri Jul 19 01:24:50 PDT 1996
>Last-Modified:  Fri Jul 19 01:26:41 PDT 1996
>Originator:     Paul Traina
>Release:        FreeBSD 2.2-CURRENT i386
>Organization:
Juniper Networks, Inc.
>Environment:

FreeBSD 2.2 current and previous versions

>Description:

_getnetbydnsname() in the standard library doesn't even begin to do the
right thing.  It needs to be rewritten from scratch, so that it behaves
more like _gethostbydnsname().

>How-To-Repeat:

Try to use -net <my-net> -mask <my-mask> conventions in /etc/exports if
dns is before bind in /etc/host.conf.

In fact, /etc/host.conf should really be split into multiple files or
we should follow the sun hack of:

	host:	hosts, dns, yp
	net:	hosts, yp

in their file.

>Fix:
	
I wrote new code to do this from scratch and then found a little reference
to RFC1101, which this (the current) code actually implements close to
correctly.

Paul Mockapetris is insane...but he figured a way around the one thing that
had me still scratching my head. :-(

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: pst 
State-Changed-When: Fri Jul 19 01:24:50 PDT 1996 
State-Changed-Why:  
Not really all that broken. 
>Unformatted:
