You're close:
$ curl -s --request PUT localhost/api/config/dns/hosts/10.10.10.10%20test | jq
{
"took": 0.00929856300354004
}
$ curl -s localhost/api/config/dns/hosts | jq
{
"config": {
"dns": {
"hosts": [
"10.10.10.10 test"
]
}
},
"took": 6.41345977783203e-05
}
$ dig +short @localhost test
10.10.10.10
$ curl -s --request PUT localhost/api/config/dns/cnameRecords/alias,pi.hole,330 | jq
{
"took": 0.04300665855407715
}
$ curl -s localhost/api/config/dns/cnameRecords | jq
{
"config": {
"dns": {
"cnameRecords": [
"alias,pi.hole,0330"
]
}
},
"took": 5.4836273193359375e-05
}
$ dig +short @localhost alias cname
pi.hole.
If want to see whats all in config:
curl -s localhost/api/config | jq
Or HTTPS:
curl -s https://localhost/api/config | jq
Or HTTPS with a self signed cert:
curl -ks https://localhost/api/config | jq