Cloud Functions: dns.resolveTxt() returns ESERVFAIL

Viewed 1248

I'm running into an issue when calling dns.resolveTxt() from Node's DNS module in a Cloud Function (tried on both Node6 and Node8)

I am using an account with billing enabled (Firebase on Blaze plan), and dns.lookup() calls are working as expected, so I don't think that it's related to calls to external domains being blocked.

Example code:

var dns = require('dns');

dns.resolveTxt('google.com', function (err, addresses) {
  console.log(addresses, err);
});

Returns proper results when run locally:

[ [ 'docusign=05958488-4752-4ef2-95eb-aa7ba8a3bd0e' ],
  [ 'facebook-domain-verification=22rm551cu4k0ab0bxsw536tlds4h95' ],
  [ 'v=spf1 include:_spf.google.com ~all' ] ] null

When executed in a Cloud Function, thew following error is returned:

{ Error: queryTxt ESERVFAIL google.com
  at QueryReqWrap.onresolve [as oncomplete] (dns.js:213:19)
  errno: 'ESERVFAIL',
  code: 'ESERVFAIL',
  syscall: 'queryTxt',
  hostname: 'google.com'
}
0 Answers
Related