DNSCache: Use iControlREST to delete the contents of a Transparent or Resolver Cache

Problem this snippet solves:

Use iControlREST to delete the contents of a DNSCache cache. Example commands are provided to delete the "rrset cache" and "msg cache" associated with a Transparent or Resolver cache.

Please note that there is no difference in the URN between the Transparent and Resolver cache types.
Please note that the "nameserver cache" is not deleted through this operation.

How to use this snippet:

The examples provided use the cURL utility. The command requires the correct partition and object name to work.

A Transparent DNSCache named "test_transparent_cache" and a Resolver DNSCache named "test_resolver_cache" were created in partition "/Common" and are used in the code snippet to follow.

Code :

Delete "Transparent Cache" Records:

curl -sk -u admin:admin -X DELETE https://10.10.40.5/mgmt/tm/ltm/dns/cache/records/rrset?options=cache+/Common/test_transparent_cache

Delete "Resolver Cache" Records:

curl -sk -u admin:admin -X DELETE https://10.10.40.5/mgmt/tm/ltm/dns/cache/records/rrset?options=cache+/Common/test_resolver_cache

Verification:

Transparent Cache Records:

tmsh show ltm dns cache records rrset cache test_transparent_cache
tmsh show ltm dns cache records msg cache test_transparent_cache

Resolver Cache Records:

tmsh show ltm dns cache records rrset cache test_resolver_cache
tmsh show ltm dns cache records msg cache test_resolver_cache

Tested this on version:

12.0
Published Nov 29, 2016
Version 1.0

Was this article helpful?

No CommentsBe the first to comment