Skip to content

Instantly share code, notes, and snippets.

View Habbie's full-sized avatar

Peter van Dijk Habbie

View GitHub Profile
@Habbie
Habbie / powerdnslab.sql
Created April 22, 2013 11:46
MySQL dump with single zone showing defect.
-- MySQL dump 10.9
--
-- Host: localhost Database: powerdnslab
-- ------------------------------------------------------
-- Server version 4.1.20
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
@Habbie
Habbie / pdns-packethandler.cc.patch
Created April 22, 2013 11:46
The patch removes the conditionals that add the spurious SOA.
Index: packethandler.cc
===================================================================
--- packethandler.cc (revision 941)
+++ packethandler.cc (working copy)
@@ -404,8 +404,6 @@
r->addRecord(rr);
}
}
- if(hits && !found && !rfound && shortcut ) // we found matching qnames but not a qtype
- return 2;
@Habbie
Habbie / pdns-tcpreceiver.cc.patch
Created April 22, 2013 11:46
Patches tcpreceiver.cc to change the order in which queries are handled.
Index: tcpreceiver.cc
===================================================================
--- tcpreceiver.cc (revision 940)
+++ tcpreceiver.cc (working copy)
@@ -169,12 +169,55 @@
continue;
}
+ // Check Packet Cache.
+ DNSPacket* cached=new DNSPacket;
@Habbie
Habbie / pdns_server-enable-verbose-logging.patch
Created April 22, 2013 11:46
Patch fixes --enable-verbose-logging compile option.
Index: packethandler.cc
===================================================================
--- packethandler.cc (revision 939)
+++ packethandler.cc (working copy)
@@ -564,7 +564,7 @@
DNSPacket *r=0;
try {
- DLOG(L << Logger::Notice<<"Remote "<<inet_ntoa( reinterpret_cast< struct sockaddr_in * >( &( p->remote ))->sin_addr )<<" wants a type " << p->qtype.getName() << " ("<<p->qtype.getCode()<<") about '"<<p->qdomain << "'" << endl);
+ DLOG(L << Logger::Notice<<"Remote "<< p->remote.toString() <<" wants a type " << p->qtype.getName() << " ("<<p->qtype.getCode()<<") about '"<<p->qdomain << "'" << endl);
@Habbie
Habbie / patch-pdns_distributor.hh
Created April 22, 2013 11:46
Patch for pdns/distributor.hh
--- pdns/distributor.hh.org Wed Mar 15 19:29:38 2006
+++ pdns/distributor.hh Wed Feb 7 19:42:24 2007
@@ -198,7 +198,7 @@
return 0;
}
catch(...) {
- L<<Logger::Error<<Logger::NTLog<<"Caught unknown exception in Distributor thread "<<(unsigned int)pthread_self()<<endl;
+ L<<Logger::Error<<Logger::NTLog<<"Caught unknown exception in Distributor thread "<<(unsigned long)pthread_self()<<endl;
delete b;
return 0;
@Habbie
Habbie / db.69.12.222
Created April 22, 2013 11:46
BIND zone file of affected zone.
$TTL 3600
$ORIGIN 222.12.69.in-addr.arpa.
@ IN SOA sonic.net. hostmaster.sonic.net. (
2006121401 ; serial
3600 ; refresh
300 ; retry
1209600 ; expire
3600 ) ; minimum ttl
IN NS a.auth-ns.sonic.net.
IN NS b.auth-ns.sonic.net.
Index: pdns/qtype.cc
===================================================================
--- pdns/qtype.cc (revision 998)
+++ pdns/qtype.cc (working copy)
@@ -59,6 +59,7 @@
insert("A6",38);
insert("NAPTR",35);
insert("SPF",99);
+ insert("IXFR",251);
insert("AXFR",252);
@Habbie
Habbie / pdns.conf
Created April 22, 2013 11:46
powerdns server configuration file
# Autogenerated configuration file template
#################################
# allow-axfr-ips Allow zonetransfers only to these subnets
#
# allow-axfr-ips=0.0.0.0/0
#################################
# allow-recursion List of subnets that are allowed to recurse
#
# allow-recursion=0.0.0.0/0
Index: pdns/dnsparser.cc
===================================================================
--- pdns/dnsparser.cc (revision 1025)
+++ pdns/dnsparser.cc (working copy)
@@ -178,7 +178,7 @@
memcpy(&d_header, packet, sizeof(dnsheader));
- if(d_header.opcode)
+ if(d_header.opcode!=0 && d_header.opcode!=4)
@Habbie
Habbie / pdns_recursor.cc.patch
Created April 22, 2013 11:46
rr=String2DNSRR(rr.qname, rr.qtype, tmp, rr.ttl);
--- pdns_recursor.cc.orig 2007-06-05 14:46:08.000000000 +0200
+++ pdns_recursor.cc 2007-06-05 14:46:34.000000000 +0200
@@ -1377,7 +1377,7 @@
while(zpt.get(rr)) {
try {
string tmp=DNSRR2String(rr);
- rr=String2DNSRR(rr.qname, rr.qtype, tmp, 3600);
+ rr=String2DNSRR(rr.qname, rr.qtype, tmp, rr.ttl);
}
catch(exception &e) {