Dnsmasq example: DNS sinkhole: Difference between revisions
From wikinotes
Line 5: | Line 5: | ||
<blockquote> | <blockquote> | ||
Based on pi-hole | Based on pi-hole | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="yaml"> | ||
log-queries # log rejected attempts | log-queries # log rejected attempts | ||
localise-queries # hostnames are localized to their subnets (allowing reuse in different subnets) | localise-queries # hostnames are localized to their subnets (allowing reuse in different subnets) |
Revision as of 19:58, 11 October 2021
See wikipedia definition.
Here, we're using it to block advertisers.
/etc/dnsmasq.d/10-sinkhole.conf
Based on pi-hole
log-queries # log rejected attempts localise-queries # hostnames are localized to their subnets (allowing reuse in different subnets) no-resolv # only configured nameservers are used (ignores resolv.conf) cache-size=10000 # keep LRU cache of 10_000 domain-names local-ttl=2 # instructs requester caches host/dhcp-leases for 2s log-async # async logging # domain-name substitution address=/example.com/ # redirect all requests to example.com to 0.0.0.0 or ::1 address=/example.com/0.0.0.0 # same addn-hosts=/etc/foobar/hosts # adds a file with several 'address=' statements # use open-dns server=208.67.222.222 server=208.67.220.220