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

Single API call to see if server/host/dns name is in use ??

New Member
Posts: 1
1274     0

Team,

 

Is there a single API call to see if a server/host/dns name is in use?

 

Essentially, when needing to provision a new server, I want to do a DNS check (of sorts) to see if a host with that name already exists, but I noticed that host-record, host-alias, cname (and possibly others) etc. are all seperate calls and objects.

 

For instance, I could have a host-alias called "myserver.mydomain.org", but if I were to do a host check against this server, it would return nothing. Similarly I could have a cname called "myserver.mydomain.org" and do a host and/or alias check, and still get nothing back because cnames are yet again different.

 

I'm hoping there is a single API call I can make that would return a match irregardless of the type, but so far I haven't been able to find it or overlooked it.

Re: Single API call to see if server/host/dns name is in use ??

Moderator
Moderator
Posts: 287
1274     0

I'm not aware of anytthign that will do exactly what you want but this seems to work pretty well.  It requires the FQDN to be split into the zone and the hostname.

 

It will return a list of matching records.  I found that for host aliases, and for DTC LBDNs it says the record type is "UNSUPPORTED".   Otherwise it will also return the record type.  An empty response would indicate the record does not exist.

 

curl -k -u admin:infoblox -X GET 'https://192.168.1.2/wapi/v2.11/allrecords' -d 'name=myhostname&zone=example.org&view=Internal%20DNS&_max_results=2'

 

 

Showing results for 
Search instead for 
Did you mean: 

Recommended for You