Skip to content

Instantly share code, notes, and snippets.

@stkchp
Last active July 26, 2016 13:00
Show Gist options
  • Save stkchp/aa61ed5ac23f22a80bb7da54d62c3ce7 to your computer and use it in GitHub Desktop.
Save stkchp/aa61ed5ac23f22a80bb7da54d62c3ce7 to your computer and use it in GitHub Desktop.
crazy patch
--- dnsmasq-2.76/src/rfc1035.c
+++ dnsmasq-2.76/src/rfc1035.c
@@ -1624,13 +1624,15 @@
ans = 1;
if (!dryrun)
{
- log_query(crecp->flags & ~F_REVERSE, name, &crecp->addr.addr,
- record_source(crecp->uid));
+ if (type != T_A) {
+ log_query(crecp->flags & ~F_REVERSE, name, &crecp->addr.addr,
+ record_source(crecp->uid));
- if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
- crec_ttl(crecp, now), NULL, type, C_IN,
- type == T_A ? "4" : "6", &crecp->addr))
- anscount++;
+ if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
+ crec_ttl(crecp, now), NULL, type, C_IN,
+ type == T_A ? "4" : "6", &crecp->addr))
+ anscount++;
+ }
}
}
} while ((crecp = cache_find_by_name(crecp, name, now, flag | F_CNAME)));
@@ -1640,10 +1642,12 @@
ans = 1;
if (!dryrun)
{
- log_query(F_FORWARD | F_CONFIG | flag, name, &addr, NULL);
- if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
- daemon->local_ttl, NULL, type, C_IN, type == T_A ? "4" : "6", &addr))
- anscount++;
+ if (type != T_A) {
+ log_query(F_FORWARD | F_CONFIG | flag, name, &addr, NULL);
+ if (add_resource_record(header, limit, &trunc, nameoffset, &ansp,
+ daemon->local_ttl, NULL, type, C_IN, type == T_A ? "4" : "6", &addr))
+ anscount++;
+ }
}
}
}
@@ -1781,6 +1785,8 @@
if (!dryrun)
log_query(F_CONFIG | F_NEG, name, &addr, NULL);
}
+ if (qtype == T_A)
+ ans = 1, nxdomain = 0;
}
if (!ans)
@stkchp
Copy link
Author

stkchp commented Jul 26, 2016

Finally, instead of this patch, i use unbound and write "private-address:0.0.0.0/0" to unbound.conf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment