- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Search for CNAME record based on hostname
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2021 02:31 AM
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.
Solved! Go to Solution.
Re: Search for CNAME record based on hostname
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2021 04:41 AM
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2021 05:29 AM
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2021 05:37 AM
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2021 06:13 AM
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"