Name resolution via TCP support

Supports _real_ name resolution via parent proxy over TCP in nserver /
dnspr.
Can be used to create UDP->TCP name proxy, e.g.

nserver 127.0.0.1/tcp
nscache 65535
auth none
dnspr
auth iponly
tcppm 53 77.88.8.8 53

now, all names are resolved via TCP connection to 77.88.8.8
(dns.yandex.ru).
This commit is contained in:
z3APA3A committed 2014-12-11 03:06:34 +03:00
1 parent e3645ee971
commit 15f9f24f04
9 files changed
+96 -37

No files matched your search

+9 -2
View File
@@ -1003,10 +1003,17 @@ static int h_flushusers(int argc, unsigned char **argv){
static int h_nserver(int argc, unsigned char **argv){
int res;
char *str;
for(res = 0; nservers[res] && res < MAXNSERVERS; res++);
for(res = 0; nservers[res].ip && res < MAXNSERVERS; res++);
if(res < MAXNSERVERS) {
nservers[res] = getip(argv[1]);
if((str = strchr((char *)argv[1], '/')))
*str = 0;
nservers[res].ip = getip(argv[1]);
if(str) {
nservers[res].usetcp = strstr(str + 1, "tcp")? 1:0;
*str = '/';
}
}
resolvfunc = myresolver;
return 0;