Error: querySrv ENODATA _mongodb._tcp.blog-cluster-0hb5z.mongodb.net at QueryReqWrap.onresolve [as oncomplete]

NasyaAS picture NasyaAS · Feb 1, 2019 · Viewed 9.6k times · Source

It looks like I cannot connect to my free Mongo Atlas cluster anymore. Everything was working and I have data that was collected when I look at the MongoDB website so I have no idea why it stopped working and can no longer connect. My entire site won't load.

This is there error I was getting:

{ Error: querySrv ENODATA _mongodb._tcp.blog-cluster-0hb5z.mongodb.net
    at QueryReqWrap.onresolve [as oncomplete] (dns.js:197:19)
  errno: 'ENODATA',
  code: 'ENODATA',
  syscall: 'querySrv',                                                                  Blog/app.js:54:14
  hostname: '_mongodb._tcp.blog-cluster-0hb5z.mongodb.net' }

Answer

copperi picture copperi · May 2, 2019

For some reason the dns server did not return srv records, changing the dns server to one that returns those records fixed the problem. (I used https://use.opendns.com/ to fix the it)