unwind(8) + adblock

man 8 unwind

# rcctl enable unwind
# echo "nameserver 127.0.0.1" > /etc/resolv.conf
# echo "lookup file bind" >> /etc/resolv.conf
# echo "supersede domain-name-servers 127.0.0.1;" >> /etc/dhclient.conf
# echo "block list \"/var/unwind.block\"" > /etc/unwind.conf
# cat /etc/rc.local
if [ -n "$(find /var/unwind.block -mtime +7 )" ]; then
    LIST="https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"
    ftp -o- "${LIST}" | \
        grep -v "^#" |\
        grep "0.0.0.0" | \
        grep -v "0.0.0.0 0.0.0.0" |\
        cut -d ' ' -f 2 > /var/unwind.block
fi

Source: