Create a Post
Showing results for 
Search instead for 
Did you mean: 

API - Host creation

I'm using the API to create hosts for the first time.

add host name MYHOST ip-address comments MY HOST


But how do I use the host-servers option to configure it as a dns-server

Ive tried:

add host name MYHOST ip-address host-servers dns-server comments MY HOST

But this fails.  I can't find any good examples anywhere.

0 Kudos
3 Replies

Based on the documentation, dns-server is a boolean value, that means True or False , host-servers dns-server "True" , try it like this.


Thanks for the reply....Tried that 😞 No luck.

Worked it out though....It's

add host host-servers.dns-server "true" name MYHOST ip-address comments "this is my Host"

0 Kudos

For reference, this JSON sent via an HTTP POST to /add-host would yield the same result:

  "name": "MYHOST",
  "ip-address": "",
  "comments": "this is my Host",
  "host-servers": {
    "dns-server": true

I add this because it's sometimes a little confusing going from the command line to JSON suitable for sending over the network.

0 Kudos