Nodejs dns module doesn't works with cloudflare

When i use nodejs dns module to retrieve txt records of a domain, it doesn’t get data.

.e.g:

dns.resolveTxt('geeksforgeeks.org').then(c=>console.log('ssss:',c)).catch(e=>console.error(e.code))

the output is:

Promise {
  <pending>,
  [Symbol(async_id_symbol)]: 2816,
  [Symbol(trigger_async_id_symbol)]: 2815
}
> [
  [ '3gar00r028hle9v71pd8u024e' ],
  [ 'fob1m1abcdp777bf2ncvnjm08n' ],
  [
    'v=spf1 include:zoho.in include:amazonses.com include:_spf.google.com ip4:167.89.66.115 include:transmail.net.in include:1278314a1.spf2.netcorecloud.net -all'
  ]
]

But if a domain being on the cloudflare it returns error ENODATA

Why?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.