Are you interested in our Early Access Program (EAP)? This program allows you to preview code, test in your lab and provide feedback prior to General Availability (GA) release of all Infoblox products. If so, please click the link here.

API Examples

Reply

Search for CNAME record based on hostname

Authority
Posts: 16
1324     0

Hi All

I got this below curl command to fetch CNAME record 

 

curl -k -u admin:infoblox -X GET "https://grid-master/wapi/v2.11/record:cname?_return_as_object=1"

but I need to fetch record based on hostname like how we search in webclient.

I need to perform delete operation for the record for which I need to fetch only the sepcific record from infoblox.

 

Please let me know on this.

Re: Search for CNAME record based on hostname

Superuser
Posts: 25
1325     0

Hi Snehasish,

You can fetch the records as per the host name by using search based on the name. You can append "?name~=<your host>" to your query to filter the results.

 

Below is an sample curl command

curl -k -u admin:infoblox -X GET "https://grid-master/wapi/v2.11/record:cname?name~=host.com&_return_as_object=1"

 

Shukran

Re: Search for CNAME record based on hostname

Authority
Posts: 16
1325     0

Hi @shukran

 

Thank for your response.

I tried using the way you told but not getting any response from postman

 

https://ddi.sgt.saint-gobain.net/wapi/v2.10.5/record:cname?name~=TEST5AP.zb.net&_return_as_object=1

below is the details

{  
    
    "canonical":"TEST5AP.zb.net",
    "name":"TEST5AP.dtc1.cf.net"
 
}

Let me know what is wrong 

Re: Search for CNAME record based on hostname

Authority
Posts: 16
1325     0

Hi

 

I got the issue. the name is case-sensative. in weblient the name is in all small letters. that's the reason it was not able to find it.

 

Is there any way to handle that?

Re: Search for CNAME record based on hostname

Superuser
Posts: 25
1325     0

Hi

 

I think you should try searching by canonical insted.

For case insensitive search you can use  ":" in the query like "?canonical:~=<your host>"

 

Sample curl

curl -k -u admin:infoblox -X GET "https://grid-master/wapi/v2.11/record:cname?canonical:~=host.com&_return_as_object=1"

 

 

Shukran
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