Infoblox’s global team of threat hunters uncovers a DNS operation with the ability to bypass traditional security measures and control the Great Firewall of China. Read about “Muddling Meerkat” and the many other threat actors discovered by Infoblox Threat Intel here.

API & Integration, DevOps,NetOps,SecOps

Reply

Add a host record to multiple DNS views with API?

New Member
Posts: 1
2610     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
2610     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