int PacketHandler::doFancyRecords(DNSPacket *p, DNSPacket *r, string &target)
{
DNSResourceRecord rr;
-
if(p->qtype.getCode()==QType::MX) // check if this domain has smtp service from us
return findMboxFW(p,r,target);
if(p->qtype.getCode()==QType::A) // search for a URL record for an A
return findUrl(p,r,target);
-
return 0;
}
if(mret==2) { // there is some data, but not of the correct type
r->clearRecords();
+
+ if(d_doFancyRecords) { // MBOXFW, URL <- fake records, emulated with MX and A
+ DLOG(L<<"There is some data, but not of the correct type, checking fancy records"<<endl);
+ int res=doFancyRecords(p,r,target);
+ if(res) { // had a result
+ if(res<0) // it was an error
+ r->setRcode(RCode::ServFail);
+ goto sendit;
+ }
+ }
DLOG(L<<"There is some data, but not of the correct type, adding SOA for NXRECORDSET"<<endl);
SOAData sd;
if(getAuth(p, &sd, target, 0)) {
if(mret == 1)
goto sendit; // this might be the end of it (client requested a CNAME, or we found the answer already)
- if(d_doFancyRecords) { // MBOXFW, URL <- fake records, emulated with MX and A
- int res=doFancyRecords(p,r,target);
- if(res) { // had a result
- if(res<0) // it was an error
- r->setRcode(RCode::ServFail);
- goto sendit;
- }
- }
// now ready to start the real direct search
NSRecordContent nrc2("ns2.powerdns.com");
nrc2.toPacket(pw);
*/
-
+ /*
DNSPacketWriter::optvect_t opts;
string ping("hallo!");
// opts.push_back(make_pair(5, ping));
pw.addOpt(5200, 0, 0x8000, opts);
pw.commit();
-
+ */
Socket sock(InterNetwork, Datagram);
IPEndpoint dest(argv[1] + (*argv[1]=='@'), atoi(argv[2]));
-
sock.sendTo(string((char*)&*packet.begin(), (char*)&*packet.end()), dest);
string reply;
cout<<i->first.d_place-1<<"\t"<<i->first.d_label<<"\tIN\t"<<DNSRecordContent::NumberToType(i->first.d_type);
cout<<"\t"<<i->first.d_ttl<<"\t"<< i->first.d_content->getZoneRepresentation()<<"\n";
}
-
+#if 0
EDNSOpts edo;
if(getEDNSOpts(mdp, &edo)) {
}
}
+#endif
}
catch(std::exception &e)
{