resolver doesn't fall back to localhost server if resolv.conf is empty

Bug #456224 reported by cwsupport
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
eglibc (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Up to Jaunty included an empty resolv.conf would make the resolver library fall back to try to use localhost as the nameserver. This is no longer the case in Karmic.

======================================
Binary package hint: bind9

Ubuntu Karmic Koala 9.10 BETA
FULLY updated via apt-get dist-upgrade

bind9: 1:9.6.1.dfsg.P1-3

After bind9 is installed hostname resolution no longer occurs on programs such as ping. However dig resolves successfully via the local server.
Bind9 has been configured to execute as a local-cache (i.e. no zones just caching forwarded requests).

/etc/resolv.conf is EMPTY.
/etc/nsswitch.conf contains:
---------------
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
---------------

/etc/bind9/named.conf.options contains:
-------------
options {
        directory "/var/cache/bind";

        // If there is a firewall between you and nameservers you want
        // to talk to, you might need to uncomment the query-source
        // directive below. Previous versions of BIND always asked
        // questions using port 53, but BIND 8.1 and later use an unprivileged
        // port by default.

        // query-source address * port 53;

        // If your ISP provided one or more IP addresses for stable
        // nameservers, you probably want to use them as forwarders.
        // Uncomment the following block, and insert the addresses replacing
        // the all-0's placeholder.

        forwarders {
212.139.132.43;
212.139.132.44;
        };

        auth-nxdomain no; # conform to RFC1035
        listen-on-v6 { any; };
};
-------------
Taking the DNS servers into /etc/resolv.conf and uninstalling bind9 results in hostname resolution being restored.

THIS WORKS UNDER Ubuntu Intrepid 8.04.

Revision history for this message
cwsupport (netsupport) wrote :

Oops. I mean Hardy Heron 8.04.

Revision history for this message
Mathias Gug (mathiaz) wrote : Re: [Bug 456224] [NEW] Installing bind9 with forwarders causes loss of hostname resolution.

On Tue, Oct 20, 2009 at 11:03:51AM -0000, cwsupport wrote:
>
> After bind9 is installed hostname resolution no longer occurs on programs such as ping.

Uses the libc name resolution stack (configured via resolv.conf).

> However dig resolves successfully via the local server.

Talks directly to the dns server, by passing the libc (and thus
resolv.conf).

> /etc/resolv.conf is EMPTY.

This is probably your problem. If resolv.conf is empty, dns name
resolution won't work. Why is resolv.conf empty? Could you check if
resolv.conf was empty *before* bind9 was installed?

  status incomplete
  importance low

--
Mathias Gug
Ubuntu Developer http://www.ubuntu.com

Mathias Gug (mathiaz)
Changed in bind9 (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
cwsupport (netsupport) wrote : Re: Installing bind9 with forwarders causes loss of hostname resolution.

Resolv.conf did have two lines with nameserver entries for the two entries that were moved to Bind9.

This configuration WORKS under Hardy Heron and AFAIK intrepid.

The problem is resolved via an entry in resolv.conf of 'nameserver 127.0.0.1'.

Before this is discounted though how come DIG still resolves (i.e. automatically uses 127.0.0.1) yet PING (and other programs) don't? This is a CHANGE from operation under Hardy Heron - The reason for me raising the issue is to ascertain that this is now correct behaviour - given that ping and dig both work with an identical setup under hardy heron.

Is it that the libc name resolution stack has changed?

Revision history for this message
Mathias Gug (mathiaz) wrote : Re: [Bug 456224] Re: Installing bind9 with forwarders causes loss of hostname resolution.

On Thu, Oct 22, 2009 at 08:24:46AM -0000, cwsupport wrote:
> Resolv.conf did have two lines with nameserver entries for the two
> entries that were moved to Bind9.
>

I can't reproduce this. Using a standard karmic system, installing the
bind9 package does *not* delete any lines in /etc/resolv.conf. It
doesn't even use the entries in /etc/resolv.conf to setup forwarders (ie
the default bind9 configuration isn't a local cache).

> Before this is discounted though how come DIG still resolves (i.e.
> automatically uses 127.0.0.1) yet PING (and other programs) don't?

DIG bypasses the libc stack (and thus resolv.conf - the same way has
host does) while ping uses the libc stack (and thus uses the information
from resolv.conf).

Is the resolvconf package installed on the system?

--
Mathias Gug
Ubuntu Developer http://www.ubuntu.com

Revision history for this message
cwsupport (netsupport) wrote : Re: [Bug 456224] Re: Installing bind9 with forwarders causes loss of hostname resolution.

Mathias Gug wrote:
> On Thu, Oct 22, 2009 at 08:24:46AM -0000, cwsupport wrote:
>
>> Resolv.conf did have two lines with nameserver entries for the two
>> entries that were moved to Bind9.
>>
>>
>
> I can't reproduce this. Using a standard karmic system, installing the
> bind9 package does *not* delete any lines in /etc/resolv.conf. It
> doesn't even use the entries in /etc/resolv.conf to setup forwarders (ie
> the default bind9 configuration isn't a local cache).
>
I never said the installer did this. I moved the lines from resolv.conf
to the forwarders section.
>
>
>> Before this is discounted though how come DIG still resolves (i.e.
>> automatically uses 127.0.0.1) yet PING (and other programs) don't?
>>
>
> DIG bypasses the libc stack (and thus resolv.conf - the same way has
> host does) while ping uses the libc stack (and thus uses the information
> from resolv.conf).
>
>
> Is the resolvconf package installed on the system?
>
Yes. Is this expected behaviour from dig? If so then I suspect the libc
stack has been fixed and no longer auto-resolves using 127.0.0.1 for DNS
services. In which case this can be closed as works for me.

--
Sincerely Yours

Copyright Witness Net Support
<email address hidden>

www.copyrightwitness.com
Registration centre for copyright works.

This e-mail and any attachments are confidential and intended for the addressee only.
The information in this mail does not amount to legal advice or opinion. Any views or legal references are those of the author and are based on personal opinion or understanding only.

Revision history for this message
Mathias Gug (mathiaz) wrote :

Marking the bug as triaged and reassigning to eglibc package since this is where the resolver is located. Up to Jaunty included an empty resolv.conf would make the resolver library fall back to try to use localhost as the nameserver. This is no longer the case in Karmic.

summary: - Installing bind9 with forwarders causes loss of hostname resolution.
+ resolver doesn't fall back to localhost server if resolv.conf is empty
affects: bind9 (Ubuntu) → eglibc (Ubuntu)
Changed in eglibc (Ubuntu):
status: Incomplete → Triaged
description: updated
Revision history for this message
Thomas Hood (jdthood) wrote :

It is the case in Quantal, anyway.

Changed in eglibc (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.