ECONNREFUSED node:internal/dns/promises:254:17


I’m new to MongoDB Atlas and have been struggling with a persistent error for quite some time now. Despite my efforts to find a solution, I haven’t been successful, and it’s becoming increasingly frustrating. I would like to emphasize that when I connect to my home Wi-Fi, everything works fine without any issues. However, when I try to connect using my phone’s hotspot or any other Wi-Fi network, I encounter this error consistently.

Error al conectar al cliente migueltejera_ecommerce Error: querySrv ECONNREFUSED
    at QueryReqWrap.onresolve [as oncomplete] (node:internal/dns/promises:254:17) {
  errno: undefined,
  syscall: 'querySrv',
  hostname: ''

I have already configured my Network Access to (including my current IP address) and have attempted various troubleshooting steps, but none of them have yielded positive results.

If someone could kindly assist me with this problem, I would greatly appreciate it. I am using Node.js for my application.

Thank you so much in advance for your help.

Hey @Miguel_Tejera,

Welcome to the MongoDB Community forums :sparkles:

I recommend checking if there are any firewall or network restrictions on the Wi-Fi networks where the error occurs. However, it seems like the DNS issue, try using Google’s DNS and Please refer to the Public DNS for more details.

Apart from this, please refer to this response and try using the connection string from the connection modal that includes all three hostnames instead of the SRV record.

If it returns a different error, please share that error message here.

In addition to the above, I would recommend also checking out the Atlas Troubleshoot Connection Issues documentation.


Dear Kushagra,

I sincerely appreciate your prompt response. I wanted to inform you that I have managed to find a solution to the connection problems I was experiencing. Although I’m not entirely sure how it started working, I tried numerous troubleshooting steps and eventually achieved success. However, I am still encountering issues with my phone hotspot. It seems that there might be a connection between my phone’s firewall settings or dynamic IP configuration and this problem. Rest assured, I will continue my efforts to resolve this.

Once again, I extend my heartfelt gratitude to you for your assistance. I will certainly update you if I am able to establish a connection using my phone.

Wishing you a fantastic day ahead.


1 Like

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