Introducing SOC Insights for BloxOne Threat Defense: Boost your SOC efficiency with AI-driven insights to eliminate manual work and accelerate investigation and response times. Read the blog announcement here.

API & Integration, DevOps,NetOps,SecOps

Reply

API call to record return empty list

New Member
Posts: 4
10394     0

Hi all,

 

I'm want to do a (simple?) GET request that resolves hostname to IPv4 address. I cannot do this via DNS, but I do have access to infoblox API. The problem is, it sometimes returnes an empty list:

 

GET wapi/v2.12.3/record:host?name~=somehostname

 

RESPONSE:

200 OK

[]

 

If I log in to Infoblox GUI and search on DNS Name I get several hits for the same hostname (A, PTR, TXT etc). There definately is a host record in infoblox for that hostname. I have tried various variants of record calls, but they all show the same behaviour. It does not seem to matter if I use ~=, = or := nor if I match the full fqdn exactly.

 

Do I use the wrong endpoint? Is there an eqvivalent of the seach function in the GUI for DNS Name?

 

Cheers,

Re: API call to record return empty list

Moderator
Moderator
Posts: 289
10395     0

Your search will only return host records that match, it won't return any other types of records.

 

You could potentially do an allrecords search but that requires knowing the zone to search in.

 

GET /wapi/v2.12/allrecords?name~=something&zone=example.org


You could also do an actual DNS dig query:

 

POST 'https://gm.example.org/wapi/v2.12/grid?_function=query_fqdn_on_member&member=gm.example.org&fqdn=www.infoblox.com'

Re: API call to record return empty list

New Member
Posts: 4
10395     0

Thanks for the reply. Explain it to me like I'm five. I get the same result if I do:

GET wapi/v2.12.3/record:a?name=somehost.domain.com

... and it obviously have an A record since I can see it in the GUI?

Re: API call to record return empty list

Moderator
Moderator
Posts: 289
10395     0

Take a look in the GUI, there may be an A record and also a HOST record with the same name & IP address.

Re: API call to record return empty list

New Member
Posts: 4
10395     0

Don't think so, but I'm better at writing code than managing Infoblox.

 

Screenshot 2024-01-12 at 21.49.08.pngScreenshot 2024-01-12 at 21.52.25.png

Re: API call to record return empty list

New Member
Posts: 4
10395     0

GIven that a search in GUI for A-record return a result (more specifically two in this case), should not an API call to record:a return the same result?

Re: API call to record return empty list

Moderator
Moderator
Posts: 289
10395     0

Yes I agree, unfortunately it's hard to know what's going on without your actual data and code and such.

 

Note that only one A record is returned in the GUI, however it's matched for multiple reasons so it's displayed multiple times.

Showing results for 
Search instead for 
Did you mean: 

Recommended for You

Businesses are investing heavily into securing company resources from cyber-attacks form cybercrimin