Reply

GET request for retrieving A records within a network range

New Member
Posts: 1
1774     0

Hello, I am looking for an API call that will return all of the A records and Host records within a network range. The goal is to retrieve all of the records within a Network. For example, if we already have the 10.10.10.0/24 network built in Infoblox, and we have 100 records within that network, I am looking to use a GET to retrieve all of those records. I am unable to find a request that would perform this within the wapidoc

 

Thank you 

Re: GET request for retrieving A records within a network range

Moderator
Moderator
Posts: 317
1774     0

Generally A & HOST records are owned by the zone they belong to, not the network.  But you can take the IPAM approach, and search for any USED IP addresses, which will return any objects assocated with those IP addresses. 

This request:

curl -k -u admin:infoblox -H "Content-Type: application/json" \
-X POST 'https://192.168.1.2/wapi/v2.12/request' -d \
'[{
    "method":"GET",
    "object":"ipv4address",
    "data": {
      "network": "192.168.9.0/24",
      "network_view": "default",
      "status": "USED"
    }
}]'

Will return lots of IP address entries, including any associated DNS records:

	{
		"_ref": "ipv4address/Li5pcHY0X2FkZHJlc3MkMTkyLjE2OC45LjIxNi8w:192.168.9.216",
		"ip_address": "192.168.9.216",
		"is_conflict": true,
		"mac_address": "",
		"names": [
			"printer.example.org"
		],
		"network": "192.168.9.0/24",
		"network_view": "default",
		"objects": [
			"record:a/ZG5zLmJpbmRfYSQuX2RlZmF1bHQubmV0d29yay5yaWNoYXJkLHJwdCwxOTIuMTY4LjkuMjE2:printer.example.org/Internal%20DNS",
			"record:ptr/ZG5zLmJpbmRfcHRyJC5fZGVmYXVsdC5hcnBhLmluLWFkZHIuMTkyLjE2OC45LjIxNi5ycHQucmljaGFyZC5uZXR3b3Jr:216.9.168.192.in-addr.arpa/Internal%20DNS"
		],
		"status": "USED",
		"types": [
			"A",
			"PTR"
		],
		"usage": [
			"DNS"
		]
	}
Showing results for 
Search instead for 
Did you mean: 

Recommended for You