I have seen few links with the same topic, still I am posting this as I feel this has something else to do.
I am facing this issue quite often, its not during the start of the project its somewhere in the middle while I am close to end Chapter 2.
Here is one point that I am not able to understand, after setting up the folder structure I have come till Chapter 2 - Get Comments, now I faced this issue again without making any changes to .env.
Is this because we are using free account & it has some limit?
Then I tried to start the project to check if its working fine & faced below issue…
Error: querySrv ESERVFAIL _mongodb._tcp.sandbox.x1gfz.mongodb.net
at QueryReqWrap.onresolve [as oncomplete] (dns.js:203:19)
Upon checking, found https://github.com/Automattic/mongoose/issues/8811
So, right now I am not able to connect to my application too.