--- pdns-recursor-3.1.7.orig/debian/control
+++ pdns-recursor-3.1.7/debian/control
@@ -0,0 +1,23 @@
+Source: pdns-recursor
+Section: net
+Priority: extra
+Standards-Version: 3.7.3.0
+Maintainer: Debian PowerDNS Maintainers <powerdns-debian@workaround.org>
+Uploaders: Christoph Haas <haas@debian.org>, Matthijs Mohlmann <matthijs@cacholong.nl>, Gerfried Fuchs <rhonda@debian.at>
+Build-Depends: debhelper (>= 5.0.0), dpatch (>= 2.0.0), dpkg-dev (> 1.10.17), libboost-dev, libboost-serialization-dev
+XS-Vcs-Svn: http://svn.cacholong.nl/cgi-bin/viewcvs.cgi/?root=pdns-recursor
+
+Package: pdns-recursor
+Architecture: alpha amd64 i386 ia64 m68k powerpc s390 kfreebsd-i386 kfreebsd-amd64
+Depends: ${shlibs:Depends}, lsb-base (>= 3.0-6), adduser
+Replaces: pdns
+Recommends: pdns-doc
+Description: PowerDNS recursor
+ PowerDNS is a versatile nameserver which supports a large number
+ of different backends ranging from simple zonefiles to relational
+ databases and load balancing/failover algorithms.
+ PowerDNS tries to emphasize speed and security.
+ .
+ This is the recursive nameserver that goes out to the internet and
+ resolve queries about other domains.
+
--- pdns-recursor-3.1.7.orig/debian/changelog
+++ pdns-recursor-3.1.7/debian/changelog
@@ -0,0 +1,124 @@
+pdns-recursor (3.1.7-1~bpo40+1) etch-backports; urgency=low
+
+  * Rebuild for etch-backports. This is taken directly from unstable due to
+    DSA-1544-2: Source port randomization did still not use
+    difficult-to-predict random numbers (CVE-2008-1637)
+
+ -- Gerfried Fuchs <rhonda@debian.at>  Wed, 16 Jul 2008 21:45:14 +0200
+
+pdns-recursor (3.1.7-1) unstable; urgency=low
+
+  * New upstream version (Closes: #490069) (Closes: #477130)
+  * init.d scripts gets socket-dir information from recursor.conf
+    (Closes: #471568)
+  * Added config file directives
+  * Set dont-query to nothing so it won't break pre-3.1.7 configs.
+    (Closes: #476841)
+
+ -- Christoph Haas <haas@debian.org>  Mon, 31 Mar 2008 21:51:59 +0200
+
+pdns-recursor (3.1.4-6) unstable; urgency=low
+
+  * Standards-Version 3.7.3.0
+  * Remove pdns_hw too on cleanup.
+  * Fix for truncating long TXT queries (Closes: #462114)
+  * Don't ignore build errors (Closes: #462128)
+  * Build option noopt was inoperative (Closes: #462126)
+  * Added gcc 4.3 fixes from upstream (Closes: #455631)
+
+ -- Matthijs Mohlmann <matthijs@cacholong.nl>  Wed, 13 Feb 2008 22:49:08 +0100
+
+pdns-recursor (3.1.4-5) unstable; urgency=low
+
+  * daemon=no is now working if used in /etc/powerdns/recursor.conf
+    (Closes: #440020)
+  * patch added to reflect change of L root server (Closes: #449483)
+  * Makefile patched to prevent stripping of binaries (Closes: #437765)
+
+ -- Christoph Haas <haas@debian.org>  Fri, 09 Nov 2007 21:57:58 +0100
+
+pdns-recursor (3.1.4-4) unstable; urgency=low
+
+  * Update to debhelper 5.
+  * Fix lintian warning: debian-rules-sets-DH_COMPAT.
+  * Restore the changelog, it was partly removed by accident. (Closes: #421393)
+  * Fix FTBFS with gcc-4.2 (Closes: #387113)
+
+ -- Matthijs Mohlmann <matthijs@cacholong.nl>  Sun, 03 Jun 2007 15:11:22 +0200
+
+pdns-recursor (3.1.4-3) unstable; urgency=low
+
+  * Stop/stop script does not return an error code when being called as
+    'stop' when the service is actually not running. (Closes: #406428)
+
+ -- Debian PowerDNS Maintainers <powerdns-debian@workaround.org>  Wed, 21 Feb 2007 23:10:00 +0200
+
+pdns-recursor (3.1.4-2) unstable; urgency=medium
+
+  * Run pdns-recursor by default as non-privileged user. (Closes: #399669)
+  * swapcontext is supported by kfreebsd (Fixes a FTBFS) (Closes: #403746)
+  * Added lsb-base to the dependencies. (Closes: #402732)
+
+ -- Matthijs Mohlmann <matthijs@cacholong.nl>  Mon, 25 Dec 2006 14:00:10 +0100
+
+pdns-recursor (3.1.4-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Matthijs Mohlmann <matthijs@cacholong.nl>  Sun, 12 Nov 2006 23:52:20 +0100
+
+pdns-recursor (3.1.3-3) unstable; urgency=low
+
+  [ Matthijs Mohlmann ]
+  * Don't build pdns-recursor for the following architectures: arm, mips,
+    mipsel, hppa and sparc. No support for swapcontext system call.
+    (Closes: #395801)
+  * Fix a big endian problem with TCP processing large answers.
+  * Fix a crash on any record we couldn't properly print for whatever reason.
+
+ -- Matthijs Mohlmann <matthijs@cacholong.nl>  Sun, 29 Oct 2006 17:50:34 +0100
+
+pdns-recursor (3.1.3-2) unstable; urgency=low
+
+  * Added patch to close a connectionless socket on an error.
+  * Added patch to fix a FD leak.
+  * Added missing lsb keyword Short-Description.
+
+ -- Debian PowerDNS Maintainers <powerdns-debian@workaround.org>  Sun,  1 Oct 2006 14:52:46 +0200
+
+pdns-recursor (3.1.3-1) unstable; urgency=low
+
+  * New upstream release.
+  * Make a lsb compliant init script, fixes a lintian warning.
+
+ -- Debian PowerDNS Maintainers <powerdns-debian@workaround.org>  Thu, 14 Sep 2006 21:20:56 +0200
+
+pdns-recursor (3.1.2-2) unstable; urgency=low
+
+  * Added patch to fix crashes on 64bit platforms (Closes: #380403)
+  * Added patch to prevent overwriting of auth data by unauth data.
+  * Fix a small memleak.
+
+ -- Debian PowerDNS Maintainers <powerdns-debian@workaround.org>  Sun,  6 Aug 2006 13:20:45 +0200
+
+pdns-recursor (3.1.2-1) unstable; urgency=low
+
+  * New upstream release.
+  * Drop build-with-g++-4.1 patch. g++ 4.1 is default now. (Closes: #376696)
+  * Fixed minor typo in recursor.conf (Closes: #369957)
+  * Add logcheck rule for pdns-recursor to suppress logcheck warnings.
+    (Closes: #367702)
+
+ -- Debian PowerDNS Maintainers <powerdns-debian@workaround.org>  Tue,  4 Jul 2006 19:16:19 +0200
+
+pdns-recursor (3.1.1-1) unstable; urgency=low
+
+  * New upstream version.
+
+ -- Debian PowerDNS Maintainers <powerdns-debian@workaround.org>  Wed, 24 May 2006 19:41:09 +0200
+
+pdns-recursor (3.0.1-1) unstable; urgency=low
+
+  * New upstream release (Closes: #366681)
+
+ -- Debian PowerDNS Maintainers <powerdns-debian@workaround.org>  Tue, 25 Apr 2006 21:27:26 +0200
--- pdns-recursor-3.1.7.orig/debian/pdns-recursor.dirs
+++ pdns-recursor-3.1.7/debian/pdns-recursor.dirs
@@ -0,0 +1,6 @@
+etc/powerdns
+etc/init.d
+etc/default
+usr/bin
+usr/sbin
+usr/share/doc/pdns-recursor
--- pdns-recursor-3.1.7.orig/debian/pdns-recursor.logcheck.ignore.server
+++ pdns-recursor-3.1.7/debian/pdns-recursor.logcheck.ignore.server
@@ -0,0 +1,4 @@
+^\w{3} [ :0-9]{11} [._[:alnum:]-]+ pdns_recursor\[[0-9]+\]: stats: [0-9]+ questions, [0-9]+ cache entries, [0-9]+ negative entries, [0-9]+% cache hits
+^\w{3} [ :0-9]{11} [._[:alnum:]-]+ pdns_recursor\[[0-9]+\]: stats: throttle map: [0-9]+, ns speeds: [0-9]+
+^\w{3} [ :0-9]{11} [._[:alnum:]-]+ pdns_recursor\[[0-9]+\]: stats: outpacket\/query ratio [0-9]+%, [0-9]+% throttled, [0-9]+ no-delegation drops
+^\w{3} [ :0-9]{11} [._[:alnum:]-]+ pdns_recursor\[[0-9]+\]: stats: [0-9]+ outgoing tcp connections, [0-9]+ queries running, [0-9]+ outgoing timeouts
--- pdns-recursor-3.1.7.orig/debian/watch
+++ pdns-recursor-3.1.7/debian/watch
@@ -0,0 +1,5 @@
+# See uscan(1) for format
+
+version=3
+http://downloads.powerdns.com/releases/pdns-recursor-([\d\.]+)\.tar\.bz2
+
--- pdns-recursor-3.1.7.orig/debian/pdns-recursor.postrm
+++ pdns-recursor-3.1.7/debian/pdns-recursor.postrm
@@ -0,0 +1,39 @@
+#! /bin/sh
+# postrm script for pdns-recursor
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postrm> `remove'
+#        * <postrm> `purge'
+#        * <old-postrm> `upgrade' <new-version>
+#        * <new-postrm> `failed-upgrade' <old-version>
+#        * <new-postrm> `abort-install'
+#        * <new-postrm> `abort-install' <old-version>
+#        * <new-postrm> `abort-upgrade' <old-version>
+#        * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+  remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+  ;;
+
+  purge)
+    update-rc.d pdns-recursor remove >/dev/null || exit 0
+  ;;
+
+  *)
+    echo "postrm called with unknown argument \`$1'" >&2
+    exit 1
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
--- pdns-recursor-3.1.7.orig/debian/copyright
+++ pdns-recursor-3.1.7/debian/copyright
@@ -0,0 +1,25 @@
+This is the Debian prepackaged version of pDNS, the PowerDNS
+nameserver.
+
+pDNS can be downloaded from http://www.powerdns.com/
+
+Copyright and license:
+
+    Copyright 2002 PowerDNS.COM BV
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of version 2 of the GNU General Public License as
+    published by the Free Software Foundation.
+
+    Additionally, the license of this program contains a special
+    exception which allows to distribute the program in binary form when
+    it is linked against OpenSSL.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+On Debian systems, the complete text of the GNU General Public License 
+can be found in /usr/share/common-licenses/GPL-2
+
--- pdns-recursor-3.1.7.orig/debian/pdns-recursor.install
+++ pdns-recursor-3.1.7/debian/pdns-recursor.install
@@ -0,0 +1,5 @@
+debian/tmp/usr/sbin/pdns_recursor usr/sbin/
+debian/tmp/usr/bin/rec_control usr/bin/
+debian/config/recursor.conf etc/powerdns/
+debian/init.d/pdns-recursor etc/init.d/
+debian/default/pdns-recursor etc/default/
--- pdns-recursor-3.1.7.orig/debian/rules
+++ pdns-recursor-3.1.7/debian/rules
@@ -0,0 +1,89 @@
+#!/usr/bin/make -f
+# 
+# debian/rules file
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+CXXFLAGS = -Wall -g
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	OPTFLAGS += -O0
+else
+	OPTFLAGS += -O3
+endif
+
+export CXXFLAGS CFLAGS OPTFLAGS
+
+# Targets
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	
+	# Add here commands to configure the package.
+	./configure
+	
+	touch configure-stamp
+
+build: patch build-stamp
+build-stamp: configure
+	
+	# Add here commands to compile the arch part of the package.
+	$(MAKE) 
+	
+	touch build-stamp
+
+clean: clean1 unpatch
+clean1:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	
+	# Add here commands to clean up after the build process.
+	rm -rf dep *.o *~ pdns_recursor pdns_hw rec_control optional/*.o optional
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+	
+	# Install the stuff
+	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
+	
+	dh_install
+
+# Build architecture (in)dependant packages.
+binary-indep:
+binary-arch: build install
+	dh_testdir -a
+	dh_testroot -a
+	dh_installchangelogs -a
+	dh_installdocs -a
+	dh_installman -a
+	dh_installlogcheck -a
+	dh_link -a
+	dh_strip -a
+	dh_compress -a
+	dh_fixperms -a
+	dh_installdeb -a
+	dh_shlibdeps -a
+	dh_gencontrol -a
+	dh_md5sums -a
+	dh_builddeb -a
+
+patch: patch-stamp
+patch-stamp:
+	dpatch apply-all
+	touch patch-stamp
+
+unpatch:
+	dpatch deapply-all
+	rm -rf patch-stamp debian/patched
+
+binary: binary-arch binary-indep
+.PHONY: build clean binary-indep binary-arch binary install configure clean1 unpatch
--- pdns-recursor-3.1.7.orig/debian/compat
+++ pdns-recursor-3.1.7/debian/compat
@@ -0,0 +1 @@
+5
--- pdns-recursor-3.1.7.orig/debian/pdns-recursor.manpages
+++ pdns-recursor-3.1.7/debian/pdns-recursor.manpages
@@ -0,0 +1,2 @@
+pdns_recursor.1
+rec_control.1
--- pdns-recursor-3.1.7.orig/debian/pdns-recursor.postinst
+++ pdns-recursor-3.1.7/debian/pdns-recursor.postinst
@@ -0,0 +1,49 @@
+#!/bin/sh
+#
+#
+
+set -e
+
+case "$1" in
+  configure)
+    if [ -z "`getent group pdns`" ]; then
+      addgroup --quiet --system pdns
+    fi
+    if [ -z "`getent passwd pdns`" ]; then
+      echo -n "Creating user and group pdns..."
+      adduser --quiet --system --home /var/spool/powerdns --shell /bin/false --ingroup pdns --disabled-password --disabled-login --gecos "PowerDNS" pdns
+      echo "done"
+    fi
+  ;;
+
+  *)
+    echo "postinst called with unknown argument \`$1'" >&2
+    exit 1
+  ;;
+esac
+
+# Remove old stuff (Coming from before 2.9.17) if Sarge is not supported anymore
+# this can be replaced by dh_installinit in debian/rules.
+if [ -f /etc/init.d/pdns_recursor ]; then
+  if [ -x /usr/sbin/invoke-rc.d ]; then
+    invoke-rc.d pdns_recursor stop || exit $?
+  else
+    /etc/init.d/pdns_recursor stop || exit $?
+  fi
+  update-rc.d -f pdns_recursor remove >/dev/null 2>&1
+  rm -f /etc/init.d/pdns_recursor
+fi
+
+if [ -x "/etc/init.d/pdns-recursor" ]; then
+  update-rc.d pdns-recursor defaults 19 85 >/dev/null
+  if [ -x /usr/sbin/invoke-rc.d ]; then
+    invoke-rc.d pdns-recursor start || exit $?
+  else
+    /etc/init.d/pdns-recursor start || exit $?
+  fi
+fi
+
+#DEBHELPER#
+
+exit 0
+
--- pdns-recursor-3.1.7.orig/debian/pdns-recursor.prerm
+++ pdns-recursor-3.1.7/debian/pdns-recursor.prerm
@@ -0,0 +1,45 @@
+#! /bin/sh
+# prerm script for pdns-recursor
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <prerm> `remove'
+#        * <old-prerm> `upgrade' <new-version>
+#        * <new-prerm> `failed-upgrade' <old-version>
+#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+#        * <deconfigured's-prerm> `deconfigure' `in-favour'
+#          <package-being-installed> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    remove|upgrade|deconfigure)
+        ;;
+    failed-upgrade)
+        ;;
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+if [ -x "/etc/init.d/pdns-recursor" ]; then
+  if [ -x /usr/sbin/invoke-rc.d ] ; then
+    invoke-rc.d pdns-recursor stop || exit $?
+  else
+    /etc/init.d/pdns-recursor stop || exit $?
+  fi
+fi
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
--- pdns-recursor-3.1.7.orig/debian/patches/gcc-4.2-ftbfs-fix.dpatch
+++ pdns-recursor-3.1.7/debian/patches/gcc-4.2-ftbfs-fix.dpatch
@@ -0,0 +1,28 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## gcc-4.2-ftbfs-fix.dpatch by Matthijs Mohlmann <matthijs@cacholong.nl>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad trunk~/recursor_cache.cc trunk/recursor_cache.cc
+--- trunk~/recursor_cache.cc	2007-07-15 17:07:30.000000000 +0200
++++ trunk/recursor_cache.cc	2007-07-15 17:08:17.688738676 +0200
+@@ -10,7 +10,7 @@
+ 
+ #include "config.h"
+ 
+-#ifdef GCC_SKIP_LOCKING
++/*#ifdef GCC_SKIP_LOCKING
+ #include <bits/atomicity.h>
+ // This code is ugly but does speedup the recursor tremendously on multi-processor systems, and even has a large effect (20, 30%) on uniprocessor 
+ namespace __gnu_cxx
+@@ -31,7 +31,7 @@
+     *__mem+=__val;
+   }
+ }
+-#endif
++#endif*/
+ 
+ string simpleCompress(const string& label)
+ {
--- pdns-recursor-3.1.7.orig/debian/patches/00list
+++ pdns-recursor-3.1.7/debian/patches/00list
@@ -0,0 +1,3 @@
+# Apply following patches
+gcc-4.2-ftbfs-fix
+do-not-strip-binaries
--- pdns-recursor-3.1.7.orig/debian/patches/do-not-strip-binaries.dpatch
+++ pdns-recursor-3.1.7/debian/patches/do-not-strip-binaries.dpatch
@@ -0,0 +1,23 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## do-not-strip-binaries.dpatch by Christoph Haas <haas@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Prevent stripping binaries upstream. Should be done by dh_strip.
+
+@DPATCH@
+diff -urNad trunk~/Makefile trunk/Makefile
+--- trunk~/Makefile	2007-11-09 22:41:01.000000000 +0100
++++ trunk/Makefile	2007-11-09 22:45:18.000000000 +0100
+@@ -54,10 +54,10 @@
+ install: all
+ 	-mkdir -p $(DESTDIR)/$(SBINDIR)
+ 	mv pdns_recursor $(DESTDIR)/$(SBINDIR)
+-	strip $(DESTDIR)/$(SBINDIR)/pdns_recursor
++	#strip $(DESTDIR)/$(SBINDIR)/pdns_recursor
+ 	mkdir -p $(DESTDIR)/$(BINDIR)
+ 	mv rec_control $(DESTDIR)/$(BINDIR)
+-	strip $(DESTDIR)/$(BINDIR)/rec_control
++	#strip $(DESTDIR)/$(BINDIR)/rec_control
+ 	-mkdir -p $(DESTDIR)/$(CONFIGDIR)
+ 	$(DESTDIR)/$(SBINDIR)/pdns_recursor --config > $(DESTDIR)/$(CONFIGDIR)/recursor.conf-dist
+ 	-mkdir -p $(DESTDIR)/usr/share/man/man1
--- pdns-recursor-3.1.7.orig/debian/default/pdns-recursor
+++ pdns-recursor-3.1.7/debian/default/pdns-recursor
@@ -0,0 +1,5 @@
+# Variables for PowerDNS recursor
+#
+# Set START to yes to start the pdns-recursor
+START=yes
+
--- pdns-recursor-3.1.7.orig/debian/config/recursor.conf
+++ pdns-recursor-3.1.7/debian/config/recursor.conf
@@ -0,0 +1,221 @@
+# Autogenerated configuration file template
+#################################
+# aaaa-additional-processing	turn on to do AAAA additional processing (slow)
+#
+# aaaa-additional-processing=off
+
+#################################
+# allow-from	If set, only allow these comma separated netmasks to recurse
+#
+# allow-from=127.0.0.0/8, 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, ::1/128, fe80::/10
+
+#################################
+# allow-from-file	If set, load allowed netmasks from this file
+#
+# allow-from-file=
+
+#################################
+# auth-can-lower-ttl	If we follow RFC 2181 to the letter, an authoritative server can lower the TTL of NS records
+#
+# auth-can-lower-ttl=off
+
+#################################
+# auth-zones	Zones for which we have authoritative data, comma separated domain=file pairs 
+#
+# auth-zones=
+
+#################################
+# chroot	switch to chroot jail
+#
+# chroot=
+
+#################################
+# client-tcp-timeout	Timeout in seconds when talking to TCP clients
+#
+# client-tcp-timeout=2
+
+#################################
+# config-dir	Location of configuration directory (recursor.conf)
+#
+# config-dir=/etc/powerdns/
+
+#################################
+# daemon	Operate as a daemon
+#
+# daemon=yes
+
+#################################
+# delegation-only	Which domains we only accept delegations from
+#
+# delegation-only=com,net
+
+#################################
+# dont-query	If set, do not query these netmasks for DNS data
+#
+# dont-query=127.0.0.0/8, 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, ::1/128, fe80::/10
+dont-query=
+
+#################################
+# entropy-source	If set, read entropy from this file
+#
+# entropy-source=/dev/urandom
+
+#################################
+# export-etc-hosts	If we should serve up contents from /etc/hosts
+#
+# export-etc-hosts=off
+
+#################################
+# fork	If set, fork the daemon for possible double performance
+#
+# fork=no
+
+#################################
+# forward-zones	Zones for which we forward queries, comma separated domain=ip pairs
+#
+# forward-zones=
+
+#################################
+# forward-zones-file	File with domain=ip pairs for forwarding
+#
+# forward-zones-file=
+
+#################################
+# hint-file	If set, load root hints from this file
+#
+# hint-file=
+
+#################################
+# ignore-rd-bit	Assume each packet requires recursion, for compatability
+#
+# ignore-rd-bit=off
+
+#################################
+# local-address	IP addresses to listen on, separated by spaces or commas. Also accepts ports.
+#
+local-address=127.0.0.1
+
+#################################
+# local-port	port to listen on
+#
+local-port=53
+
+#################################
+# log-common-errors	If we should log rather common errors
+#
+# log-common-errors=yes
+
+#################################
+# logging-facility	Facility to log messages as. 0 corresponds to local0
+#
+# logging-facility=
+
+#################################
+# max-cache-entries	If set, maximum number of entries in the main cache
+#
+# max-cache-entries=0
+
+#################################
+# max-negative-ttl	maximum number of seconds to keep a negative cached entry in memory
+#
+# max-negative-ttl=3600
+
+#################################
+# max-tcp-clients	Maximum number of simultaneous TCP clients
+#
+# max-tcp-clients=128
+
+#################################
+# max-tcp-per-client	If set, maximum number of TCP sessions per client (IP address)
+#
+# max-tcp-per-client=0
+
+#################################
+# no-shuffle	Don't change
+#
+# no-shuffle=off
+
+#################################
+# query-local-address	Source IP address for sending queries
+#
+# query-local-address=0.0.0.0
+
+#################################
+# query-local-address6	Source IPv6 address for sending queries
+#
+# query-local-address6=
+
+#################################
+# quiet	Suppress logging of questions and answers
+#
+quiet=yes
+
+#################################
+# remotes-ringbuffer-entries	maximum number of packets to store statistics for
+#
+# remotes-ringbuffer-entries=0
+
+#################################
+# serve-rfc1918	If we should be authoritative for RFC 1918 private IP space
+#
+# serve-rfc1918=
+
+#################################
+# server-id	Returned when queried for 'id.server' TXT, defaults to hostname
+#
+# server-id=
+
+#################################
+# setgid	If set, change group id to this gid for more security
+#
+setgid=pdns
+
+#################################
+# setuid	If set, change user id to this uid for more security
+#
+setuid=pdns
+
+#################################
+# single-socket	If set, only use a single socket for outgoing queries
+#
+# single-socket=off
+
+#################################
+# soa-minimum-ttl	Don't change
+#
+# soa-minimum-ttl=0
+
+#################################
+# soa-serial-offset	Don't change
+#
+# soa-serial-offset=0
+
+#################################
+# socket-dir	Where the controlsocket will live
+# HINT: If you change this from the default /var/run then rec_control
+#       will still search in /var/run for the socket file. Keep in mind
+#       to run it as 'rec_control --socket-dir=/your/socket/directory' then.
+#
+# socket-dir=/var/run/
+
+#################################
+# spoof-nearmiss-max	If non-zero, assume spoofing after this many near misses
+#
+# spoof-nearmiss-max=20
+
+#################################
+# stack-size	stack size per mthread
+#
+# stack-size=200000
+
+#################################
+# trace	if we should output heaps of logging
+#
+# trace=off
+
+#################################
+# version-string	string reported on version.pdns or version.bind
+#
+# version-string=PowerDNS Recursor 3.1.5 $Id: pdns_recursor.cc 1170 2008-03-22 20:43:44Z ahu $
+
+
--- pdns-recursor-3.1.7.orig/debian/init.d/pdns-recursor
+++ pdns-recursor-3.1.7/debian/init.d/pdns-recursor
@@ -0,0 +1,165 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          pdns-recursor
+# Required-Start:    networking
+# Required-Stop:     networking
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 6
+# Short-Description: Start the recursor at boot time.
+### END INIT INFO
+
+#
+# Authors:	Matthijs Mohlmann <matthijs@cacholong.nl>
+#           Christoph Haas <haas@debian.org>
+# 
+# Thanks to:
+# Thomas Hood <jdthood@aglu.demon.nl>
+#
+# initscript for PowerDNS recursor
+
+set -e
+
+. /lib/lsb/init-functions
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DESC="PowerDNS recursor"
+NAME=pdns_recursor
+DAEMON=/usr/sbin/$NAME
+# Derive the socket-dir setting from /etc/powerdns/recursor.conf
+# or fall back to the default /var/run if not specified there.
+PIDDIR=$(awk -F= '/^socket-dir=/ {print $2}' /etc/powerdns/recursor.conf)
+if [ -z "$PIDDIR" ]; then PIDDIR=/var/run; fi
+PIDFILE=$PIDDIR/$NAME.pid
+
+# Gracefully exit if the package has been removed.
+test -x $DAEMON || exit 0
+
+# Read config file if it is present.
+if [ -r /etc/default/pdns-recursor ]; then
+  . /etc/default/pdns-recursor
+fi
+
+start() {
+# Return
+#  0 if daemon has been started / was already running
+#  >0 if daemon could not be started
+  start-stop-daemon --start --oknodo --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null || return 0
+  start-stop-daemon --start --oknodo --quiet --pidfile $PIDFILE --exec $DAEMON || return 2
+}
+
+start_resolvconf() {
+  if [ -x /sbin/resolvconf ]; then
+    echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo.pdns-recursor
+  fi
+  return 0
+}
+
+stop() {
+  start-stop-daemon --stop --oknodo --quiet --retry=TERM/5/KILL/5 --pidfile $PIDFILE --name $NAME
+  rm -f $PIDFILE	# just in case
+}
+
+force_stop() {
+    killall -v -9 pdns_recursor
+    echo "killed"
+}
+
+stop_resolvconf() {
+  if [ -x /sbin/resolvconf ]; then
+    /sbin/resolvconf -d lo.pdns-recursor
+  fi
+  return 0
+}
+
+case "$1" in
+  start)
+    if [ "$START" != "yes" ]; then
+      log_begin_msg "Not starting $DESC -- disabled."
+      log_end_msg 0
+      exit 0
+    fi
+    log_daemon_msg "Starting $DESC" "pdns-recursor"
+    start
+    case "$?" in
+      0)
+        start_resolvconf
+        break
+        ;;
+      1)
+        log_progress_msg "(already running)"
+        break
+        ;;
+      *)
+        log_progress_msg " (failed)."
+        log_end_msg 1
+        exit 1
+        ;;
+    esac
+    log_end_msg 0
+  ;;
+  stop)
+    stop_resolvconf
+    log_daemon_msg "Stopping $DESC" "pdns-recursor"
+    stop
+    case "$?" in
+      0)
+        break
+        ;;
+      1)
+        log_progress_msg "(not running)"
+        break
+        ;;
+      *)
+        log_progress_msg "(failed)"
+        log_end_msg 1
+        exit 1
+        ;;
+    esac
+    log_end_msg 0
+  ;;
+  restart|force-reload)
+    if [ "$START" != "yes" ]; then
+      $0 stop
+      exit 0
+    fi
+    log_daemon_msg "Restarting $DESC" "pdns-recursor"
+    stop
+    case "$?" in
+      0|1)
+        start
+        case "$?" in
+          0)
+            log_end_msg 0
+            exit 0
+            ;;
+          1)
+            log_progress_msg "(failed -- old process still running)"
+            log_end_msg 1
+            exit 1
+            ;;
+          *)
+            log_progress_msg "(failed to start)"
+            log_end_msg 1
+            exit 1
+            ;;
+        esac
+      ;;
+      *)
+        log_progress_msg "(failed to stop)"
+        log_end_msg 1
+        exit 1
+      ;;
+    esac
+  ;;
+  force-stop)
+    force_stop
+    exit 0
+  ;;
+  *)
+    echo "Usage: $0 {start|stop|restart|force-reload|force-stop}" >&2
+    exit 3
+  ;;
+esac
+
+exit 0
+
