Teachable resolver.
More...
#include <fstream>
#include <vector>
#include <map>
#include <stdexcept>
#include "sclasses.hh"
#include <signal.h>
#include <random>
#include "record-types.hh"
#include <thread>
|
DNSMessageReader | getResponse (const ComboAddress &server, const DNSName &dn, const DNSType &dt, int depth=0) |
|
ResolveResult | resolveAt (const DNSName &dn, const DNSType &dt, int depth=0, const DNSName &auth={}, const multimap< DNSName, ComboAddress > &mservers=g_root) |
|
void | processQuery (int sock, ComboAddress client, DNSMessageReader dmr) |
| This is a thread that will create an answer to the query in dmr More...
|
|
int | main (int argc, char **argv) |
|
This function guarantees that you will get an answer from this server. It will drop EDNS for you and eventually it will even fall back to TCP for you. If nothing works, an exception is thrown. Note that this function does not think about actual DNS errors, you get those back verbatim. Only the TC bit is checked.
This function does check if the ID field of the response matches the query, but the caller should check qname and qtype.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
This is a thread that will create an answer to the query in dmr
This attempts to look up the name dn with type dt. The depth parameter is for trace output. the 'auth' field describes the authority of the servers we will be talking to. Defaults to root ('believe everything') The multimap specifies the servers to try with. Defaults to a list of root-servers.
set this if you have no functioning IPv6
unsigned int g_numqueries |
multimap<DNSName, ComboAddress> g_root |