diff --git a/README.md b/README.md index 79de2ec..6487b78 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,6 @@ See [doc/example.conf](doc/example.conf) for more details. ### Global directives * `geoip_dir` (optional) - path to a directory containing GeoIP databases -* `dns_server` (optional) - address of a DNS server ### Configuration diff --git a/src/lib/config.c b/src/lib/config.c index 6ac4a03..e463da5 100644 --- a/src/lib/config.c +++ b/src/lib/config.c @@ -61,9 +61,6 @@ static int config_parse_line(char *line, char *section, int *i, int *j) { if (len > 10 && strncmp(ptr, "geoip_dir", 9) == 0 && (ptr[9] == ' ' || ptr[9] == '\t')) { source = ptr + 9; target = config.geoip_dir; - } else if (len > 11 && strncmp(ptr, "dns_server", 10) == 0 && (ptr[10] == ' ' || ptr[10] == '\t')) { - source = ptr + 10; - target = config.dns_server; } else { return -1; } diff --git a/src/lib/config.h b/src/lib/config.h index 7479474..3e8b102 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -53,7 +53,6 @@ typedef struct { host_config_t hosts[CONFIG_MAX_HOST_CONFIG]; cert_config_t certs[CONFIG_MAX_CERT_CONFIG]; char geoip_dir[256]; - char dns_server[256]; } config_t; extern config_t config; diff --git a/src/worker/tcp_acceptor.c b/src/worker/tcp_acceptor.c index 305f022..c20419f 100644 --- a/src/worker/tcp_acceptor.c +++ b/src/worker/tcp_acceptor.c @@ -33,7 +33,7 @@ static int dig(const char *addr, char *host, size_t host_size) { FILE *out; int ret; - sprintf(buf, "dig @%s +short +time=1 -x %s", config.dns_server, addr); + sprintf(buf, "dig +short +time=1 -x %s", addr); if ((out = popen(buf, "r")) == NULL) { error("Unable to start dig: %s"); return -1; @@ -85,8 +85,7 @@ static int tcp_acceptor(client_ctx_t *ctx) { ctx->cnx_s = clock_micros(); ctx->host[0] = 0; - if (config.dns_server[0] != 0) - dig(ctx->socket.addr, ctx->host, sizeof(ctx->host)); + dig(ctx->socket.addr, ctx->host, sizeof(ctx->host)); ctx->cc[0] = 0; geoip_lookup_country(&client->_addr.sock, ctx->cc);