Making Squid 3.1 respect more than one search domain when parsing resolv.conf

From: James Brotchie <brotchie_at_gmail.com>
Date: Thu, 10 Dec 2009 11:12:40 +1000

Hi,

Currently (as of 3.1.0.14) Squid's inbuilt resolver only respects the
last domain or search directive in /etc/resolv.conf.

Before each search or domain directive is processed idnsFreeSearchpath
(in dns_internal.cc) is called, clearing any existing search paths.
The desired behaviour in our scenario is to append all domain and
search directives to the list of resolver search paths.

Removing the idnsFreeSearchpath calls at dns_internal.cc:321,331 makes
squid behave as desired.

Does anyone know the rationale behind throwing away the search path
prior to processing each resolv.conf directive? Is this simply a
bug/oversight? Should a configuration option be added at compile time
or in squid.conf to adjust this behaviour?

EXAMPLE
=======
--- start /etc/resolv.conf ---

search nb
search test.com
search extra.domain.net
nameserver 127.0.0.1

--- end /etc/resolv.conf ---

Current squid domain lookup order for www:
www
www.extra.domain.net

Squid domain lookup order for www with idnsFreeSearchpath removed:
www
www.nb
www.test.com
www.extra.domain.net

Regards,
James Brotchie
Received on Thu Dec 10 2009 - 01:44:25 MST

This archive was generated by hypermail 2.2.0 : Thu Dec 10 2009 - 12:00:02 MST