From owner-freebsd-questions@FreeBSD.ORG Thu Jan 17 06:49:30 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 21694482 for ; Thu, 17 Jan 2013 06:49:30 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email2.allantgroup.com (email2.emsphone.com [199.67.51.116]) by mx1.freebsd.org (Postfix) with ESMTP id A4D44846 for ; Thu, 17 Jan 2013 06:49:29 +0000 (UTC) Received: from dan.emsphone.com (dan.emsphone.com [172.17.17.101]) by email2.allantgroup.com (8.14.5/8.14.5) with ESMTP id r0H6nKFJ079172 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Jan 2013 00:49:20 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.6/8.14.6) with ESMTP id r0H6nKaU069951 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Jan 2013 00:49:20 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.6/8.14.5/Submit) id r0H6nKM6069950; Thu, 17 Jan 2013 00:49:20 -0600 (CST) (envelope-from dan) Date: Thu, 17 Jan 2013 00:49:20 -0600 From: Dan Nelson To: Tim Daneliuk Subject: Re: OT: What Might Break getbostbyname() ? Message-ID: <20130117064920.GD42469@dan.emsphone.com> References: <50F7783F.7020406@tundraware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50F7783F.7020406@tundraware.com> X-OS: FreeBSD 8.3-STABLE User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: clamav-milter 0.97.6 at email2.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (email2.allantgroup.com [172.17.19.78]); Thu, 17 Jan 2013 00:49:20 -0600 (CST) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on email2.allantgroup.com X-Scanned-By: MIMEDefang 2.73 Cc: FreeBSD Mailing List X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jan 2013 06:49:30 -0000 In the last episode (Jan 16), Tim Daneliuk said: > This is not really a FreeBSD problem ... in fact, it's happening on a > Solaris 10 machine. But because the TCP stack and its userland interface > came from BSD, I am hoping some kind soul might have an insight into > what's going on ... Solaris hasn't used a BSD TCP stack for many many years afaik.. > The machine in question does DNS lookups fine via dig or nslookup. I > believe these connect directly to the DNS server(s) specified in > /etc/resolv.conf. > > However, any program that uses gethostbyname() - like ping - fails and > says it cannot resolve the name. > > I'm looking for hints here on why or how gethostbyname() and/or the > network stack could get clobbered so as to not be able to talk to the DNS > servers which I know are reachable via dig and nslookup. First, check /etc/nsswitch.conf and verify that "dns" is listed on the "hosts:" line. Next, try disabling nscd ("svcadm disable name-service-cache") , and then running "truss ping www.google.com" (make sure to reenable nscd when you're done debugging). You should see syscalls to open /etc/resolv.conf, read the contents, and then open a socket to the nameserver listed in that file. -- Dan Nelson dnelson@allantgroup.com