Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
Tutorials and FAQs
»
Automatically create Unbound DNS entries over the API
« previous
next »
Print
Pages: [
1
]
Author
Topic: Automatically create Unbound DNS entries over the API (Read 6506 times)
MAK3SN0sense
Newbie
Posts: 2
Karma: 0
Automatically create Unbound DNS entries over the API
«
on:
December 01, 2021, 05:36:05 pm »
Hello everybody,
to increase efficiancy in our network I am trying to automatically create DNS entries when my Ansible routines are creating new VMs. We are using the Unbound DNS module of OPNsense and I found this documentation:
https://docs.opnsense.org/development/api/core/unbound.html
Unfortunatelly, it's not very detailed and explains little, I managed to create a token for my OPNsense user and access the API to get some statistic information with Postman but there seems to be nothing which allows me to create overrides. My research of the last hours showed little, some refference to the above mentioned API, others say it's not supported and suggest to manipulate the configuration XML instead.
Does anybody know what the current state of the Unbound DNS API is and if I can archieve the following tasks?
Create new DNS entries without collision
Delete a DNS entry
Apply changes
Maybe there are helpful tutorials which I simply didn't find you know of?
I would like to avoid having to manipulate the XML configuration on a productive firewall or to parse the webinterface.
Thank you very much.
Logged
mimugmail
Hero Member
Posts: 6766
Karma: 494
Re: Automatically create Unbound DNS entries over the API
«
Reply #1 on:
December 02, 2021, 07:25:48 am »
Unbound is not API enabled, you could do this with bind plugin
Logged
WWW:
www.routerperformance.net
Support plans:
https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German):
https://opnsense.max-it.de/
MAK3SN0sense
Newbie
Posts: 2
Karma: 0
Re: Automatically create Unbound DNS entries over the API
«
Reply #2 on:
December 02, 2021, 09:40:46 am »
Good morning,
thank you for your answer mimugmail.
Quote from: mimugmail on December 02, 2021, 07:25:48 am
Unbound is not API enabled, you could do this with bind plugin
Was afraid so
, but the bind module looks a lot better, will discuss this with our firewall department.
Also, maybe it helps someone else, I noticed that in the API documentation section, each controller has a model.xml attached to it which appears to describe the required POST request payloads. Guess XML is required interally by OPNsense, for documentation purposes though it is a little confusing that the API payloads are supposed to be in JSON and the explaination is in XML, potentially requiring a user to try out what works or not. JSON examples would help inexperienced users.
Again, thanks for your fast help
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
Tutorials and FAQs
»
Automatically create Unbound DNS entries over the API