Skip to content

What's the best way to utilize unbound with lists?

Prajwal Koirala edited this page Dec 31, 2021 · 10 revisions

Installing the lists

Hosts

echo "include: /etc/unbound/unbound.conf.d/hosts.conf" >>/etc/unbound/unbound.conf
curl "https://raw.githubusercontent.com/complexorganizations/content-blocker/main/assets/hosts" | awk '$1' | awk '{print "local-zone: \""$1"\" redirect\nlocal-data: \""$1" IN A 0.0.0.0\""}' >/etc/unbound/unbound.conf.d/hosts.conf

Updating the lists

Hosts

curl "https://raw.githubusercontent.com/complexorganizations/content-blocker/main/assets/hosts" | awk '$1' | awk '{print "local-zone: \""$1"\" redirect\nlocal-data: \""$1" IN A 0.0.0.0\""}' >/etc/unbound/unbound.conf.d/hosts.conf

Last but not least, remember to restart unbound.

systemctl restart unbound
service unbound restart