THE GAME HAS CHANGED

Introducing Infoblox Universal DDI ManagementTM

Watch the launch to discover the new era of management for critical network services. Watch Now

API & Integration, DevOps,NetOps,SecOps

Reply

Add a host record to multiple DNS views with API?

New Member
Posts: 1
3252     0

For our external-facing web servers, we typically put them in both our external and internal DNS views using the web interface. I'm trying to script this process using the REST API, and running into a problem: I can add a host record to the first view, but when I try to to add the second record in the other view, I get an error, " (400) Bad Request".

 

I'm scripting this in PowerShell using

 Invoke-WebRequest 
-UseBasicParsing
-Uri "https://<address>/wapi/v2.5record:host"
-Method Post
-Body '{ "ipv4addrs": [ { "ipv4addr": "<ipaddr>", "mac": "<macaddr>" }], "name": "<fqdn>" , "view": "external" }'
-ContentType "application/json"
-Credential $c

It doesn't matter which view I enter first, "internal" or "external". The second one always fails because a host record already exists in the other view.

 

What am I missing?

Re: Add a host record to multiple DNS views with API?

Adviser
Posts: 11
3252     0

The mac address in both records is causing the conflict because Infoblox is creating a DHCP reservation for that mac under the hood. You can either remove the mac from one copy of the record or explicitly specify the "configure_for_dhcp" field to "false" in one or both of them.

 

[{"ipv4addr":"<ip>","mac":"<mac>","configure_for_dhcp":false}]
Showing results for 
Search instead for 
Did you mean: 

Recommended for You