Date: Thu, 17 Jan 2013 00:49:20 -0600 From: Dan Nelson <dnelson@allantgroup.com> To: Tim Daneliuk <tundra@tundraware.com> Cc: FreeBSD Mailing List <freebsd-questions@freebsd.org> Subject: Re: OT: What Might Break getbostbyname() ? Message-ID: <20130117064920.GD42469@dan.emsphone.com> In-Reply-To: <50F7783F.7020406@tundraware.com> References: <50F7783F.7020406@tundraware.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130117064920.GD42469>
