mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Don't forward *.bind/*.server queries upstream
Chaos .bind and .server (RFC4892) zones are local, therefore don't forward queries upstream to avoid mixing with supported locally and false replies with NO_ID enabled.
This commit is contained in:
committed by
Simon Kelley
parent
ee8750451b
commit
cf5984367b
@@ -1276,7 +1276,7 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
|
|||||||
int q, ans, anscount = 0, addncount = 0;
|
int q, ans, anscount = 0, addncount = 0;
|
||||||
int dryrun = 0;
|
int dryrun = 0;
|
||||||
struct crec *crecp;
|
struct crec *crecp;
|
||||||
int nxdomain = 0, auth = 1, trunc = 0, sec_data = 1;
|
int nxdomain = 0, notimp = 0, auth = 1, trunc = 0, sec_data = 1;
|
||||||
struct mx_srv_record *rec;
|
struct mx_srv_record *rec;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
@@ -1355,6 +1355,17 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (qclass == C_CHAOS)
|
||||||
|
{
|
||||||
|
/* don't forward *.bind and *.server chaos queries */
|
||||||
|
if (hostname_issubdomain("bind", name) || hostname_issubdomain("server", name))
|
||||||
|
{
|
||||||
|
if (!ans)
|
||||||
|
notimp = 1, auth = 0;
|
||||||
|
ans = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (qclass == C_IN)
|
if (qclass == C_IN)
|
||||||
{
|
{
|
||||||
struct txt_record *t;
|
struct txt_record *t;
|
||||||
@@ -1903,6 +1914,8 @@ size_t answer_request(struct dns_header *header, char *limit, size_t qlen,
|
|||||||
|
|
||||||
if (nxdomain)
|
if (nxdomain)
|
||||||
SET_RCODE(header, NXDOMAIN);
|
SET_RCODE(header, NXDOMAIN);
|
||||||
|
else if (notimp)
|
||||||
|
SET_RCODE(header, NOTIMP);
|
||||||
else
|
else
|
||||||
SET_RCODE(header, NOERROR); /* no error */
|
SET_RCODE(header, NOERROR); /* no error */
|
||||||
header->ancount = htons(anscount);
|
header->ancount = htons(anscount);
|
||||||
|
|||||||
Reference in New Issue
Block a user