1
General Discussion / Re: Problem with api for Unbound AddHostOverride
« on: November 07, 2023, 02:41:02 pm »
Instead of
curl -X POST -d '{"host":{"enabled":"1","hostname":"test","domain":"testdomain.com","rr":{"A":{"value":"A (IPv4 address)","selected":1},"AAAA":{"value":"AAAA (IPv6 address)","selected":0},"MX":{"value":"MX (Mail server)","selected":0}},"mxprio":"","mx":"","server":"10.0.1.1","description":""}}' -H "Content-Type: application/json" -k -u $OPNS_KEY:$OPNS_SECRET https://$IPFW/api/unbound/settings/AddHostOverride
this will do the job:
curl -X POST -d '{"host":{"enabled":"1","hostname":"test","domain":"testdomain.com","rr":"A","mxprio":"","mx":"","server":"10.0.1.1","description":""}}' -H "Content-Type: application/json" -k -u $OPNS_KEY:$OPNS_SECRET https://$IPFW/api/unbound/settings/AddHostOverride
curl -X POST -d '{"host":{"enabled":"1","hostname":"test","domain":"testdomain.com","rr":{"A":{"value":"A (IPv4 address)","selected":1},"AAAA":{"value":"AAAA (IPv6 address)","selected":0},"MX":{"value":"MX (Mail server)","selected":0}},"mxprio":"","mx":"","server":"10.0.1.1","description":""}}' -H "Content-Type: application/json" -k -u $OPNS_KEY:$OPNS_SECRET https://$IPFW/api/unbound/settings/AddHostOverride
this will do the job:
curl -X POST -d '{"host":{"enabled":"1","hostname":"test","domain":"testdomain.com","rr":"A","mxprio":"","mx":"","server":"10.0.1.1","description":""}}' -H "Content-Type: application/json" -k -u $OPNS_KEY:$OPNS_SECRET https://$IPFW/api/unbound/settings/AddHostOverride