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.