diff -ru pdns-3.3.3/pdns/common_startup.cc pdns-3.3.3-spuriousrrs-167732/pdns/common_startup.cc
--- pdns-3.3.3/pdns/common_startup.cc	2015-06-08 13:59:02.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/common_startup.cc	2016-12-09 11:16:24.032794180 +0100
@@ -231,8 +231,8 @@
 {
   DNSPacket *P;
   DNSDistributor *distributor = new DNSDistributor(::arg().asNum("distributor-threads")); // the big dispatcher!
-  DNSPacket question;
-  DNSPacket cached;
+  DNSPacket question(true);
+  DNSPacket cached(false);
 
   unsigned int &numreceived=*S.getPointer("udp-queries");
   unsigned int &numanswered=*S.getPointer("udp-answers");
diff -ru pdns-3.3.3/pdns/dnsbulktest.cc pdns-3.3.3-spuriousrrs-167732/pdns/dnsbulktest.cc
--- pdns-3.3.3/pdns/dnsbulktest.cc	2015-06-08 13:59:02.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/dnsbulktest.cc	2016-12-09 11:16:37.535929461 +0100
@@ -116,7 +116,7 @@
       }
       // parse packet, set 'id', fill out 'ip' 
       
-      MOADNSParser mdp(string(buf, len));
+      MOADNSParser mdp(false, string(buf, len));
       if(!g_quiet) {
         cout<<"Reply to question for qname='"<<mdp.d_qname<<"', qtype="<<DNSRecordContent::NumberToType(mdp.d_qtype)<<endl;
         cout<<"Rcode: "<<mdp.d_header.rcode<<", RD: "<<mdp.d_header.rd<<", QR: "<<mdp.d_header.qr;
diff -ru pdns-3.3.3/pdns/dnsdemog.cc pdns-3.3.3-spuriousrrs-167732/pdns/dnsdemog.cc
--- pdns-3.3.3/pdns/dnsdemog.cc	2015-06-08 13:59:02.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/dnsdemog.cc	2016-12-09 11:16:54.015688588 +0100
@@ -47,7 +47,7 @@
           if(dh->rd || dh->qr)
             continue;
 
-          MOADNSParser mdp((const char*)pr.d_payload, pr.d_len);
+          MOADNSParser mdp(false, (const char*)pr.d_payload, pr.d_len);
 
           memcpy(&entry.ip, &pr.d_ip->ip_src, 4);
           entry.port = pr.d_udp->uh_sport;
diff -ru pdns-3.3.3/pdns/dnsgram.cc pdns-3.3.3-spuriousrrs-167732/pdns/dnsgram.cc
--- pdns-3.3.3/pdns/dnsgram.cc	2015-06-08 13:59:02.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/dnsgram.cc	2016-12-09 11:17:00.998920132 +0100
@@ -111,7 +111,7 @@
           ntohs(pr.d_udp->uh_dport)==53   || ntohs(pr.d_udp->uh_sport)==53) &&
          pr.d_len > 12) {
         try {
-          MOADNSParser mdp((const char*)pr.d_payload, pr.d_len);
+          MOADNSParser mdp(false, (const char*)pr.d_payload, pr.d_len);
           if(mdp.d_header.id==htons(4575)) {
 //            cerr << ntohl(*(uint32_t*)&pr.d_ip->ip_src)<<endl;
             g_skipped++;
diff -ru pdns-3.3.3/pdns/dnspacket.cc pdns-3.3.3-spuriousrrs-167732/pdns/dnspacket.cc
--- pdns-3.3.3/pdns/dnspacket.cc	2015-06-08 13:59:02.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/dnspacket.cc	2016-12-09 11:18:48.937365589 +0100
@@ -46,7 +46,7 @@
 
 bool DNSPacket::s_doEDNSSubnetProcessing;
 
-DNSPacket::DNSPacket() 
+DNSPacket::DNSPacket(bool isQuery)
 {
   d_wrapped=false;
   d_compress=true;
@@ -54,6 +54,7 @@
   d_wantsnsid=false;
   d_haveednssubnet = false;
   d_dnssecOk=false;
+  d_isQuery = isQuery;
 }
 
 const string& DNSPacket::getString()
@@ -108,6 +109,8 @@
 
   d_rawpacket=orig.d_rawpacket;
   d=orig.d;
+
+  d_isQuery = orig.d_isQuery;
 }
 
 void DNSPacket::setRcode(int v)
@@ -363,7 +366,7 @@
 /** convenience function for creating a reply packet from a question packet. Do not forget to delete it after use! */
 DNSPacket *DNSPacket::replyPacket() const
 {
-  DNSPacket *r=new DNSPacket;
+  DNSPacket *r=new DNSPacket(false);
   r->setSocket(d_socket);
   r->d_anyLocal=d_anyLocal;
   r->setRemote(&d_remote);
@@ -441,7 +444,7 @@
 
 bool DNSPacket::getTSIGDetails(TSIGRecordContent* trc, string* keyname, string* message) const
 {
-  MOADNSParser mdp(d_rawpacket);
+  MOADNSParser mdp(d_isQuery, d_rawpacket);
 
   if(!mdp.getTSIGPos()) 
     return false;
@@ -480,7 +483,7 @@
     return -1;
   }
 
-  MOADNSParser mdp(d_rawpacket);
+  MOADNSParser mdp(d_isQuery, d_rawpacket);
   EDNSOpts edo;
 
   // ANY OPTION WHICH *MIGHT* BE SET DOWN BELOW SHOULD BE CLEARED FIRST!
diff -ru pdns-3.3.3/pdns/dnspacket.hh pdns-3.3.3-spuriousrrs-167732/pdns/dnspacket.hh
--- pdns-3.3.3/pdns/dnspacket.hh	2015-06-08 13:59:02.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/dnspacket.hh	2016-12-09 11:19:33.373401590 +0100
@@ -73,7 +73,7 @@
 class DNSPacket
 {
 public:
-  DNSPacket();
+  DNSPacket(bool isQuery);
   DNSPacket(const DNSPacket &orig);
 
   int noparse(const char *mesg, int len); //!< just suck the data inward
@@ -178,6 +178,7 @@
   string d_tsigkeyname;
   string d_tsigprevious;
   bool d_tsigtimersonly;
+  bool d_isQuery;
 
   vector<DNSResourceRecord> d_rrs; // 4
 };
diff -ru pdns-3.3.3/pdns/dnsparser.cc pdns-3.3.3-spuriousrrs-167732/pdns/dnsparser.cc
--- pdns-3.3.3/pdns/dnsparser.cc	2015-06-08 13:59:02.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/dnsparser.cc	2016-12-09 11:21:57.068059530 +0100
@@ -138,7 +138,7 @@
   memcpy(&packet[pos], &drh, sizeof(drh)); pos+=sizeof(drh);
   memcpy(&packet[pos], serialized.c_str(), serialized.size()); pos+=(uint16_t)serialized.size();
 
-  MOADNSParser mdp((char*)&*packet.begin(), (unsigned int)packet.size());
+  MOADNSParser mdp(false, (char*)&*packet.begin(), (unsigned int)packet.size());
   shared_ptr<DNSRecordContent> ret= mdp.d_answers.begin()->first.d_content;
   ret->header.d_type=ret->d_qtype;
   ret->label=mdp.d_answers.begin()->first.d_label;
@@ -195,7 +195,7 @@
   return zmakermap;
 }
 
-void MOADNSParser::init(const char *packet, unsigned int len)
+void MOADNSParser::init(bool query, const char *packet, unsigned int len)
 {
   if(len < sizeof(dnsheader))
     throw MOADNSException("Packet shorter than minimal header");
@@ -209,6 +209,9 @@
   d_header.ancount=ntohs(d_header.ancount);
   d_header.nscount=ntohs(d_header.nscount);
   d_header.arcount=ntohs(d_header.arcount);
+
+  if (query && (d_header.qdcount > 1))
+    throw MOADNSException("Query with QD > 1 ("+lexical_cast<string>(d_header.qdcount)+")");
   
   uint16_t contentlen=len-sizeof(dnsheader);
 
@@ -253,7 +256,13 @@
       dr.d_label=label;
       dr.d_clen=ah.d_clen;
 
-      dr.d_content=boost::shared_ptr<DNSRecordContent>(DNSRecordContent::mastermake(dr, pr));
+      if (query && (dr.d_place == DNSRecord::Answer || dr.d_place == DNSRecord::Nameserver || (dr.d_type != QType::OPT && dr.d_type != QType::TSIG && dr.d_type != QType::SIG) || ((dr.d_type == QType::TSIG || dr.d_type == QType::SIG) && dr.d_class != 0xff))) {
+        dr.d_content=boost::shared_ptr<DNSRecordContent>(new UnknownRecordContent(dr, pr));
+      }
+      else {
+        dr.d_content=boost::shared_ptr<DNSRecordContent>(DNSRecordContent::mastermake(dr, pr));
+      }
+
       d_answers.push_back(make_pair(dr, pr.d_pos));
 
       if(dr.d_type == QType::TSIG && dr.d_class == 0xff) 
diff -ru pdns-3.3.3/pdns/dnsparser.hh pdns-3.3.3-spuriousrrs-167732/pdns/dnsparser.hh
--- pdns-3.3.3/pdns/dnsparser.hh	2015-06-08 13:59:02.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/dnsparser.hh	2016-12-09 11:22:42.180770529 +0100
@@ -299,15 +299,15 @@
 {
 public:
   //! Parse from a string
-  MOADNSParser(const string& buffer)  : d_tsigPos(0)
+  MOADNSParser(bool query, const string& buffer)  : d_tsigPos(0)
   {
-    init(buffer.c_str(), (unsigned int)buffer.size());
+    init(query, buffer.c_str(), (unsigned int)buffer.size());
   }
 
   //! Parse from a pointer and length
-  MOADNSParser(const char *packet, unsigned int len) : d_tsigPos(0)
+  MOADNSParser(bool query, const char *packet, unsigned int len) : d_tsigPos(0)
   {
-    init(packet, len);
+    init(query, packet, len);
   }
 
   dnsheader d_header;
@@ -333,7 +333,7 @@
   }
 private:
   void getDnsrecordheader(struct dnsrecordheader &ah);
-  void init(const char *packet, unsigned int len);
+  void init(bool query, const char *packet, unsigned int len);
   vector<uint8_t> d_content;
   uint16_t d_tsigPos;
 };
diff -ru pdns-3.3.3/pdns/dnsproxy.cc pdns-3.3.3-spuriousrrs-167732/pdns/dnsproxy.cc
--- pdns-3.3.3/pdns/dnsproxy.cc	2015-06-08 13:59:02.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/dnsproxy.cc	2016-12-09 11:22:56.717237403 +0100
@@ -181,7 +181,7 @@
         d.id=i->second.id;
         memcpy(buffer,&d,sizeof(d));  // commit spoofed id
 
-        DNSPacket p,q;
+        DNSPacket p(false),q(false);
         p.parse(buffer,len);
         q.parse(buffer,len);
 
diff -ru pdns-3.3.3/pdns/dnsreplay.cc pdns-3.3.3-spuriousrrs-167732/pdns/dnsreplay.cc
--- pdns-3.3.3/pdns/dnsreplay.cc	2015-06-08 13:59:02.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/dnsreplay.cc	2016-12-09 11:23:25.556842027 +0100
@@ -340,7 +340,7 @@
   while(s_socket->recvFromAsync(packet, remote)) {
     try {
       s_weanswers++;
-      MOADNSParser mdp(packet.c_str(), packet.length());
+      MOADNSParser mdp(false, packet.c_str(), packet.length());
       if(!mdp.d_header.qr) {
         cout<<"Received a question from our reference nameserver!"<<endl;
         continue;
@@ -494,7 +494,7 @@
       sent=true;
       dh->id=tmp;
     }
-    MOADNSParser mdp((const char*)pr.d_payload, pr.d_len);
+    MOADNSParser mdp(false, (const char*)pr.d_payload, pr.d_len);
     QuestionIdentifier qi=QuestionIdentifier::create(pr.d_ip, pr.d_udp, mdp);
     
     if(!mdp.d_header.qr) {
diff -ru pdns-3.3.3/pdns/dnsscan.cc pdns-3.3.3-spuriousrrs-167732/pdns/dnsscan.cc
--- pdns-3.3.3/pdns/dnsscan.cc	2015-06-08 13:59:02.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/dnsscan.cc	2016-12-09 11:23:38.883326430 +0100
@@ -47,7 +47,7 @@
     
     while(pr.getUDPPacket()) {
       try {
-        MOADNSParser mdp((const char*)pr.d_payload, pr.d_len);
+        MOADNSParser mdp(false, (const char*)pr.d_payload, pr.d_len);
         if(mdp.d_qtype < 256)
           counts[mdp.d_qtype]++;
 
diff -ru pdns-3.3.3/pdns/dnsscope.cc pdns-3.3.3-spuriousrrs-167732/pdns/dnsscope.cc
--- pdns-3.3.3/pdns/dnsscope.cc	2015-06-08 13:59:02.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/dnsscope.cc	2016-12-09 11:23:46.986549067 +0100
@@ -61,7 +61,7 @@
         ntohs(pr.d_udp->uh_dport)==53   || ntohs(pr.d_udp->uh_sport)==53) &&
         pr.d_len > 12) {
       try {
-        MOADNSParser mdp((const char*)pr.d_payload, pr.d_len);
+        MOADNSParser mdp(false, (const char*)pr.d_payload, pr.d_len);
 
         lowestTime=min((time_t)lowestTime,  (time_t)pr.d_pheader.ts.tv_sec);
         highestTime=max((time_t)highestTime, (time_t)pr.d_pheader.ts.tv_sec);
diff -ru pdns-3.3.3/pdns/dnstcpbench.cc pdns-3.3.3-spuriousrrs-167732/pdns/dnstcpbench.cc
--- pdns-3.3.3/pdns/dnstcpbench.cc	2015-06-08 13:59:02.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/dnstcpbench.cc	2016-12-09 11:23:59.883039757 +0100
@@ -91,7 +91,7 @@
     q->udpUsec = makeUsec(now - tv);
     tv=now;
 
-    MOADNSParser mdp(reply);
+    MOADNSParser mdp(false, reply);
     if(!mdp.d_header.tc)
       return;
     g_truncates++;
@@ -141,7 +141,7 @@
   q->tcpUsec = makeUsec(now - tv);
   q->answerSecond = now.tv_sec;
 
-  MOADNSParser mdp(reply);
+  MOADNSParser mdp(false, reply);
   //  cout<<"Had correct TCP/IP response, "<<mdp.d_answers.size()<<" answers, aabit="<<mdp.d_header.aa<<endl;
   if(mdp.d_header.aa)
     g_authAnswers++;
diff -ru pdns-3.3.3/pdns/lwres.cc pdns-3.3.3-spuriousrrs-167732/pdns/lwres.cc
--- pdns-3.3.3/pdns/lwres.cc	2015-06-08 13:59:04.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/lwres.cc	2016-12-09 11:24:08.609587482 +0100
@@ -165,7 +165,7 @@
   lwr->d_result.clear();
   try {
     lwr->d_tcbit=0;
-    MOADNSParser mdp((const char*)buf.get(), len);
+    MOADNSParser mdp(false, (const char*)buf.get(), len);
     lwr->d_aabit=mdp.d_header.aa;
     lwr->d_tcbit=mdp.d_header.tc;
     lwr->d_rcode=mdp.d_header.rcode;
diff -ru pdns-3.3.3/pdns/mastercommunicator.cc pdns-3.3.3-spuriousrrs-167732/pdns/mastercommunicator.cc
--- pdns-3.3.3/pdns/mastercommunicator.cc	2015-06-08 13:59:04.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/mastercommunicator.cc	2016-12-09 11:24:19.609437708 +0100
@@ -137,7 +137,7 @@
     size=recvfrom(sock,buffer,sizeof(buffer),0,(struct sockaddr *)&from,&fromlen);
     if(size < 0)
       break;
-    DNSPacket p;
+    DNSPacket p(true);
 
     p.setRemote(&from);
 
diff -ru pdns-3.3.3/pdns/nameserver.cc pdns-3.3.3-spuriousrrs-167732/pdns/nameserver.cc
--- pdns-3.3.3/pdns/nameserver.cc	2015-06-08 13:59:04.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/nameserver.cc	2016-12-09 11:24:31.312611874 +0100
@@ -415,7 +415,7 @@
   if(prefilled)  // they gave us a preallocated packet
     packet=prefilled;
   else
-    packet=new DNSPacket; // don't forget to free it!
+    packet=new DNSPacket(true); // don't forget to free it!
   packet->d_dt.set(); // timing
   packet->setSocket(sock);
   packet->setRemote(&remote);
diff -ru pdns-3.3.3/pdns/notify.cc pdns-3.3.3-spuriousrrs-167732/pdns/notify.cc
--- pdns-3.3.3/pdns/notify.cc	2015-06-08 13:59:04.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/notify.cc	2016-12-09 11:24:42.362461768 +0100
@@ -59,7 +59,7 @@
     throw runtime_error("Unable to receive notification response from PowerDNS: "+stringerror());
 
   string packet(buffer, len);
-  MOADNSParser mdp(packet);
+  MOADNSParser mdp(false, packet);
 
   cerr<<"Received notification response with code: "<<mdp.d_header.rcode<<endl;
   cerr<<"For: '"<<mdp.d_qname<<"'"<<endl;
diff -ru pdns-3.3.3/pdns/nproxy.cc pdns-3.3.3-spuriousrrs-167732/pdns/nproxy.cc
--- pdns-3.3.3/pdns/nproxy.cc	2015-06-08 13:59:04.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/nproxy.cc	2016-12-09 11:24:59.825558191 +0100
@@ -66,7 +66,7 @@
     throw runtime_error("reading packet from remote: "+stringerror());
     
   string packet(buffer, res);
-  MOADNSParser mdp(packet);
+  MOADNSParser mdp(true, packet);
   nif.domain = mdp.d_qname;
   nif.origID = mdp.d_header.id;
 
@@ -136,7 +136,7 @@
     throw runtime_error("reading packet from remote: "+stringerror());
     
   string packet(buffer, len);
-  MOADNSParser mdp(packet);
+  MOADNSParser mdp(false, packet);
 
   //  cerr<<"Inside notification response for: "<<mdp.d_qname<<endl;
 
diff -ru pdns-3.3.3/pdns/nsec3dig.cc pdns-3.3.3-spuriousrrs-167732/pdns/nsec3dig.cc
--- pdns-3.3.3/pdns/nsec3dig.cc	2015-06-08 13:59:04.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/nsec3dig.cc	2016-12-09 11:25:15.032018879 +0100
@@ -109,7 +109,7 @@
   string reply(creply, len);
   delete[] creply;
 
-  MOADNSParser mdp(reply);
+  MOADNSParser mdp(false, reply);
   cout<<"Reply to question for qname='"<<mdp.d_qname<<"', qtype="<<DNSRecordContent::NumberToType(mdp.d_qtype)<<endl;
   cout<<"Rcode: "<<mdp.d_header.rcode<<", RD: "<<mdp.d_header.rd<<", QR: "<<mdp.d_header.qr;
   cout<<", TC: "<<mdp.d_header.tc<<", AA: "<<mdp.d_header.aa<<", opcode: "<<mdp.d_header.opcode<<endl;
diff -ru pdns-3.3.3/pdns/pdns_recursor.cc pdns-3.3.3-spuriousrrs-167732/pdns/pdns_recursor.cc
--- pdns-3.3.3/pdns/pdns_recursor.cc	2015-06-08 13:59:04.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/pdns_recursor.cc	2016-12-09 11:25:47.471580417 +0100
@@ -126,7 +126,7 @@
 
 //! used to send information to a newborn mthread
 struct DNSComboWriter {
-  DNSComboWriter(const char* data, uint16_t len, const struct timeval& now) : d_mdp(data, len), d_now(now), 
+  DNSComboWriter(const char* data, uint16_t len, const struct timeval& now) : d_mdp(true, data, len), d_now(now), 
         											        d_tcp(false), d_socket(-1)
   {}
   MOADNSParser d_mdp;
diff -ru pdns-3.3.3/pdns/resolver.cc pdns-3.3.3-spuriousrrs-167732/pdns/resolver.cc
--- pdns-3.3.3/pdns/resolver.cc	2015-06-08 13:59:04.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/resolver.cc	2016-12-09 11:26:17.521175357 +0100
@@ -216,7 +216,7 @@
     throw ResolverException("recvfrom error waiting for answer: "+stringerror());
   }
   
-  MOADNSParser mdp((char*)buf, err);
+  MOADNSParser mdp(false, (char*)buf, err);
   *id=mdp.d_header.id;
   *domain = stripDot(mdp.d_qname);
   
@@ -270,7 +270,7 @@
     if((len=recvfrom(sock, buffer, sizeof(buffer), 0,(struct sockaddr*)(&from), &addrlen)) < 0) 
       throw ResolverException("recvfrom error waiting for answer: "+stringerror());
   
-    MOADNSParser mdp(buffer, len);
+    MOADNSParser mdp(false, buffer, len);
     return parseResult(mdp, domain, type, id, res);
   }
   catch(ResolverException &re) {
@@ -386,7 +386,7 @@
     throw ResolverException("EOF trying to read axfr chunk from remote TCP client");
   
   timeoutReadn(len); 
-  MOADNSParser mdp(d_buf.get(), len);
+  MOADNSParser mdp(false, d_buf.get(), len);
 
   int err = parseResult(mdp, "", 0, 0, &res);
   if(err) 
diff -ru pdns-3.3.3/pdns/sdig.cc pdns-3.3.3-spuriousrrs-167732/pdns/sdig.cc
--- pdns-3.3.3/pdns/sdig.cc	2015-06-08 13:59:04.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/sdig.cc	2016-12-09 11:26:38.320895561 +0100
@@ -124,7 +124,7 @@
     
     sock.recvFrom(reply, dest);
   }
-  MOADNSParser mdp(reply);
+  MOADNSParser mdp(false, reply);
   cout<<"Reply to question for qname='"<<mdp.d_qname<<"', qtype="<<DNSRecordContent::NumberToType(mdp.d_qtype)<<endl;
   cout<<"Rcode: "<<mdp.d_header.rcode<<", RD: "<<mdp.d_header.rd<<", QR: "<<mdp.d_header.qr;
   cout<<", TC: "<<mdp.d_header.tc<<", AA: "<<mdp.d_header.aa<<", opcode: "<<mdp.d_header.opcode<<endl;
diff -ru pdns-3.3.3/pdns/secpoll-auth.cc pdns-3.3.3-spuriousrrs-167732/pdns/secpoll-auth.cc
--- pdns-3.3.3/pdns/secpoll-auth.cc	2015-06-08 13:59:04.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/secpoll-auth.cc	2016-12-09 11:26:46.657450215 +0100
@@ -96,7 +96,7 @@
     catch(...) {
       continue;
     }
-    MOADNSParser mdp(reply);
+    MOADNSParser mdp(false, reply);
     if(mdp.d_header.rcode == RCode::ServFail)
       continue;    
     
diff -ru pdns-3.3.3/pdns/speedtest.cc pdns-3.3.3-spuriousrrs-167732/pdns/speedtest.cc
--- pdns-3.3.3/pdns/speedtest.cc	2015-06-08 13:59:04.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/speedtest.cc	2016-12-09 11:26:59.953938371 +0100
@@ -485,7 +485,7 @@
 
   void operator()() const
   {
-    MOADNSParser mdp((const char*)&*d_packet.begin(), d_packet.size());
+    MOADNSParser mdp(false, (const char*)&*d_packet.begin(), d_packet.size());
     typedef map<pair<string, QType>, set<DNSResourceRecord>, TCacheComp > tcache_t;
     tcache_t tcache;
     
@@ -651,7 +651,7 @@
 
   void operator()() const
   {
-    MOADNSParser mdp((const char*)&*d_packet.begin(), d_packet.size());
+    MOADNSParser mdp(false, (const char*)&*d_packet.begin(), d_packet.size());
   }
   const vector<uint8_t>& d_packet;
   std::string d_name;
diff -ru pdns-3.3.3/pdns/tcpreceiver.cc pdns-3.3.3-spuriousrrs-167732/pdns/tcpreceiver.cc
--- pdns-3.3.3/pdns/tcpreceiver.cc	2015-06-08 13:59:04.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/tcpreceiver.cc	2016-12-09 11:27:48.126626441 +0100
@@ -267,7 +267,7 @@
       getQuestion(fd, mesg, pktlen, remote);
       S.inc("tcp-queries");      
 
-      packet=shared_ptr<DNSPacket>(new DNSPacket);
+      packet=shared_ptr<DNSPacket>(new DNSPacket(true));
       packet->setRemote(&remote);
       packet->d_tcp=true;
       packet->setSocket(fd);
@@ -281,7 +281,7 @@
       }
 
       shared_ptr<DNSPacket> reply; 
-      shared_ptr<DNSPacket> cached= shared_ptr<DNSPacket>(new DNSPacket);
+      shared_ptr<DNSPacket> cached= shared_ptr<DNSPacket>(new DNSPacket(false));
       if(logDNSQueries)  {
         string remote;
         if(packet->hasEDNSSubnet()) 
diff -ru pdns-3.3.3/pdns/test-dnsrecords_cc.cc pdns-3.3.3-spuriousrrs-167732/pdns/test-dnsrecords_cc.cc
--- pdns-3.3.3/pdns/test-dnsrecords_cc.cc	2015-06-08 13:59:04.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/test-dnsrecords_cc.cc	2016-12-09 11:28:44.222544378 +0100
@@ -246,14 +246,15 @@
   std::string packet("\xf0\x01\x01\x00\x00\x01\x00\x01\x00\x00\x00\x01\x03www\x08powerdns\x03""com\x00\x00\x01\x00\x01\x03www\x08powerdns\x03""com\x00\x00\x01\x00\x01\x00\x00\x00\x10\x00\x04\x7f\x00\x00\x01\x00\x00\x29\x05\x00\x00\x00\x00\x00\x00\x0c\x00\x03\x00\x08powerdns",89);
   OPTRecordContent::report();
 
-  MOADNSParser mdp((char*)&*packet.begin(), (unsigned int)packet.size());
+  MOADNSParser mdp(true, (char*)&*packet.begin(), (unsigned int)packet.size());
 
-  getEDNSOpts(mdp, &eo);
+  BOOST_CHECK_EQUAL(getEDNSOpts(mdp, &eo), true);
 
   // this should contain NSID now
   BOOST_CHECK_EQUAL(eo.d_packetsize, 1280);
    
   // it should contain NSID option with value 'powerdns', and nothing else
+  BOOST_CHECK_EQUAL(eo.d_options.size(), 1);
   BOOST_CHECK_EQUAL(eo.d_options[0].first, 3); // nsid
   BOOST_CHECK_EQUAL(eo.d_options[0].second, "powerdns");
 }
diff -ru pdns-3.3.3/pdns/tsig-tests.cc pdns-3.3.3-spuriousrrs-167732/pdns/tsig-tests.cc
--- pdns-3.3.3/pdns/tsig-tests.cc	2015-06-08 13:59:04.000000000 +0200
+++ pdns-3.3.3-spuriousrrs-167732/pdns/tsig-tests.cc	2016-12-09 11:29:07.342236559 +0100
@@ -62,7 +62,7 @@
   string reply;
   sock.recvFrom(reply, dest);
 
-  MOADNSParser mdp(reply);
+  MOADNSParser mdp(false, reply);
   cout<<"Reply to question for qname='"<<mdp.d_qname<<"', qtype="<<DNSRecordContent::NumberToType(mdp.d_qtype)<<endl;
   cout<<"Rcode: "<<mdp.d_header.rcode<<", RD: "<<mdp.d_header.rd<<", QR: "<<mdp.d_header.qr;
   cout<<", TC: "<<mdp.d_header.tc<<", AA: "<<mdp.d_header.aa<<", opcode: "<<mdp.d_header.opcode<<endl;
