OPNsense Forum

English Forums => General Discussion => Topic started by: nykaer on April 23, 2021, 04:48:21 pm

Title: Unbound: Bulk add host-entries (overrides)
Post by: nykaer on April 23, 2021, 04:48:21 pm
I have quite a few host overrides I need to enter into our OPNsense.

Looked at the API, and I does not include these entries.  I could manually enter them into /var/unbound/cat host_entries.conf.   But according to docs, that will not survive a reboot.

Any ideas, before I spends hours "cURL'ing my way out of the problem??

/Nykaer
Title: Re: Unbound: Bulk add host-entries (overrides)
Post by: Patrick M. Hausen on April 23, 2021, 05:24:25 pm
Download a configuration (System --> Configuration --> Backups), examine the XML file you get. Populate the XML with your entries, restore config in the UI.

I did that for BIND zone entries, not difficult to script. If you are seriously pondering using curl, it shouldn't be difficult for you.
Title: Re: Unbound: Bulk add host-entries (overrides)
Post by: nykaer on April 23, 2021, 06:13:39 pm
That would work just fine..  Sold.

Thank you for the solution.