3 ms·
It's inefficient to specify a large number of hosts in the facebook.com domain instead of blocking the whole domain. For this, you can run dnsmasq and use the
by kazinator 10y ago
It's inefficient to specify a large number of hosts in the facebook.com domain instead of blocking the whole domain.
For this, you can run dnsmasq and use the "--address" option or "address" command in dnsmasq.conf:
$ man dnsmasq
[...]
-A, --address=/<domain>/[domain/]<ipaddr>
Specify an IP address to return for any host in the given
domains. Queries in the domains are never forwarded and always
replied to with the specified IP address which may be IPv4 or
IPv6. To give both IPv4 and IPv6 addresses for a domain, use
repeated -A flags. Note that /etc/hosts and DHCP leases over‐
ride this for individual names. A common use of this is to redi‐
rect the entire doubleclick.net domain to some friendly local
web server to avoid banner ads. The domain specification works
in the same was as for --server, with the additional facility
that /#/ matches any domain. Thus --address=/#/1.2.3.4 will
always return 1.2.3.4 for any query not answered from /etc/hosts
or DHCP and not sent to an upstream nameserver by a more spe‐
cific --server directive.
- yrro 10y agoIs there the concept of an 'administratively prohibited' error in the DNS? So your resolver could return an error with that code rather than an incorrect result.
- Borating 10y agoNXDOMAIN [1] ? Dnsmasq can return nxdomain responses echo 'server=/.example.tld/' >> /etc/dnsmasq.conf Check dnsgate [2] or FreeContributor [3] [1] https://www.dnsknowledge.com/whatis/nxdomain-non-existent-domain-2/ https://www.dnsknowledge.com/whatis/nxdomain-non-existent-do... [2] https://github.com/jakeogh/dnsgate https://github.com/jakeogh/dnsgate [3] https://github.com/tbds/FreeContributor https://github.com/tbds/FreeContributor
- fanf2 10y agoSadly not. The closest match is probably SERVFAIL, but that covers all sorts of problems. (SERVFAIL is what a validating recursive server will return if its upstream tries to NXDOMAIN a signed domain.)
- deleted 10y ago[deleted]