Package: dnsmasq
Version: 2.33-1+b1
Severity: normal
Tags: patch

I have to use a VPN connection (using vpnc) for some of my work.
The same hostname might then resolve to a different IP address
when the VPN connection is up or down.
resolvconf correctly updates /var/run/dnsmasq/resolv.conf,
and dnsmasq recognizes the change (logged to syslog).
However, dnsmasq continues to return stale information
from its cache.
The attached patch sends SIGHUP to dnsmasq after the resolv.conf
change to clear the cache.

I wonder if this is generally the right thing to do, but
it fixes my problem. I think ideally dnsmasq should have
a config option to clear the cache automatically when it
detects a resolv.conf change.


Thanks,
Johannes

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18
Locale: LANG=C, [EMAIL PROTECTED] (charmap=ISO-8859-15)

Versions of packages dnsmasq depends on:
ii  adduser                      3.97        Add and remove users and groups
ii  libc6                        2.3.6.ds1-5 GNU C Library: Shared libraries
ii  libdbus-1-3                  0.93-1      simple interprocess messaging syst
ii  netbase                      4.27        Basic TCP/IP networking system

dnsmasq recommends no packages.

-- no debconf information
--- dnsmasq.orig        2006-01-22 14:12:31.000000000 +0100
+++ dnsmasq     2006-10-07 22:37:49.000000000 +0200
@@ -20,6 +20,7 @@
 RUN_DIR="/var/run/dnsmasq"
 RSLVRLIST_FILE="${RUN_DIR}/resolv.conf"
 TMP_FILE="${RSLVRLIST_FILE}_new.$$"
+PID_FILE="/var/run/dnsmasq.pid"
 
 [ -x /usr/sbin/dnsmasq ] || exit 0
 [ -x /lib/resolvconf/list-records ] || exit 1
@@ -61,4 +62,5 @@
 for N in $NMSRVRS ; do echo "nameserver $N" >> "$TMP_FILE" ; done
 mv -f "$TMP_FILE" "$RSLVRLIST_FILE"
 
-
+# clear dnsmasq cache
+/sbin/start-stop-daemon --quiet --stop --pidfile $PID_FILE --signal HUP || :

Reply via email to