Unbound DNS server at boot

Started by Gary7, May 12, 2019, 09:07:06 PM

Previous topic - Next topic
I've configured Unbound to block advertising (and tracking) URLs. I followed the setup from https://devinstechblog.com/block-ads-with-dns-in-opnsense/ and added some more blacklists.

I have a slight Unbound problem when my firewall boots.
I'm using an APC2D4 with RAM disks for /tmp and /var and I'm using Unbound custom option "include:/var/unbound/ad-blacklist.conf". I could like to continue using the conf file in /var since I'm updating the list daily.
At boot, the /var/unbound/ad-blacklist.conf doesn't exist and Unbound won't start.
I'm using a somewhat crude method at startup: using a boot cron script, sleep for a length of time, touch /var/unbound/ad-blacklist.conf, start Unbound, sleep for a little while longer while Unbound starts, then run the rest of the script to download blacklists and create ad-blacklist.conf and restart Unbound again.

Is there any good way to create an empty file, /var/unbound/ad-blacklist.conf or any custom .conf, as Unbound starts ? That way, Unbound starts normally and I only have one re-start of Unbound?