Reply

Search for CNAME record based on hostname

Authority
Posts: 16
735     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

Authority
Posts: 15
736     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"

 

Re: Search for CNAME record based on hostname

Authority
Posts: 16
736     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
736     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

Authority
Posts: 15
736     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"

 

 

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