Can't Connect to MongoDB Atlas after switching network

I’m getting an ECONNREFUSED error when trying to connect to MongoDB. When I remove the SRV protocol from the connection string, I get an IP whitelist error instead (0.0.0.0/0 is included in Network Access). I can use MongoDB Compass and mongosh with the same credentials I’m using on my nodejs app.

P.S. This started happening after a thunderstorm caused a short brownout. After that, my Ethernet connection stopped working, so I switched to Wi-Fi and the problem shows up.

Does your WiFi Router include a Firewall? Usually, that’s the case, have a look whether connection is blocked by firewall settings.

Hi thanks for the reply. I already solved it, it’s a DNS issue