- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Add a host record to multiple DNS views with API?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2021 01:36 PM
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?
Solved! Go to Solution.
Re: Add a host record to multiple DNS views with API?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2021 12:01 PM
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}]