Unbound safesearch question

Started by jaydub, April 28, 2023, 05:44:26 PM

Previous topic - Next topic
I'm so glad to see the unbound safesearch option that can be turned on with a checkbox in version 23. That is so convenient. The safesearch.conf file is very thorough.

I want to force everything but youtube to safesearch (we create youtube content that is clean but youtube seems they are labeling them adult so the safesearch is blocking some of our videos). Looking in the safesearch.conf file, I deleted the youtube section and saved it in VI. When restarting the service unbound put youtube back in that file.

Is there a way I can work around this?  I tried domain overrides and then host overrides for individual sites but I wasn't successful but perhaps I just need a tutorial.

What would be a nice feature is to be able to select which search engines to use safesearch kind of like the DNSBL blocklists has. 

Thanks to everyone who works on this.

Not sure if this will work, but you could try:

  • Stop unbound
  • Make changes to the safesearch.conf file
  • Start unbound
This could be a potential solution because sometimes configuration objects are held in memory and then written out to file when the service stops. The technique you described would result in your changes being overwritten in such circumstances.

The better file to edit is /usr/local/opnsense/service/templates/OPNsense/Unbound/core/safesearch.conf but even this one is overwritten on updates.

I'm not sure what we want here. You could also disable safesearch, but copy the effective configuration to e.g. /usr/local/etc/unbound.opnsense.d/safesearch2.conf and it works without interruptions from this point forward... just make sure to never switch safesearch back on in the GUI.


Cheers,
Franco