Since DNS is on π₯ today I should note if you're a Splunk shop, the DNS data model in Enterprise Security does not include the field for TXT record values, you need to add that manually.
Then you can do high-fidelity detections such as length and base64 with conversions looking for code.