Reply

Search for CNAME record based on hostname

Authority
Posts: 18
5819     1

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: 38
5819     1

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: 18
5819     1

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: 18
5819     1

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: 38
5819     1

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