Forum Discussion
How can I remove a DNS Cache Record Using F5 REST API
i want removing DNS old, invalid DNS cache records from F5 using REST API, but no resource or sample available. Using tmsh, it can be done within 3 commands like below; but we dont wanne use tmsh because of performance issues. Can any one done this before and can share the code sample? Thanks
response = sshService.execute("tmsh");
logger.info("TMSH response:" + response);
response = sshService.execute("ltm dns cache records");
logger.info("LTM response:" + response);
response = sshService.execute("delete rrset type a cache " + url);
logger.info("DELETE response:" + response);
response = sshService.execute("quit");
2 Replies
- JRahm
Admin
I can get all the different resource records from the rest interface like this:
/mgmt/tm/ltm/dns/cache/records/rrset?options=cache+/Common/mycache+type+aaaaExcept for "a" records, which errors out, so you might open a case on that. To remove them, you'll need the resource ID from that output, then you can just do a delete to here:
/mgmt/tm/ltm/dns/cache/records/rrset/~resource id - David_Karakas
Employee
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
Will delete the RRSET and MSG Cache for a cache named "/Common/test_trasparent_cache"
Verified on BIG-IP v12.1.0-HF1
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com