使用 javascript 从通过 JSON 返回的域获取 TXT 记录

Getting a TXT record from a domain returned via JSON using javascript

有没有办法使用 javascript 和 JSON 格式获取域的 TXT 记录?我不确定浏览器是否内置了一些东西。或者是否有提供 JSON 输出的服务?

使用Node.js:dns.resolveTxt(域,回调)(http://nodejs.org/api/dns.html

如果您需要在 客户端 执行此操作,您可以尝试:https://dns-api.org/TXT/google.com。这种方法有其局限性:

Clients are limited to 200 lookups per hour, and clients who are abusive or otherwise greedy will be blocked with no notice. If you rely upon this service than you should consider installing your own instance, as this is not a commercial service with any guarantee of availability, reliability, or accuracy.