Cannot connect to MongoDB Atlas Cluster: DNSHostNotFound

后端 未结 3 723
傲寒
傲寒 2021-01-23 08:53

I created a new cluster in MongoDB Atlas but I can\'t connect to it thru the mongo shell.

C:\\git_symphony\\esp8266\\SymphonySocket>mongo \"mongodb+srv://<         


        
相关标签:
3条回答
  • 2021-01-23 09:16
    • Have you whitelisted your IP address ? IP whitelisting is important otherwise it will not connect.
    • Have you created this cluster recently and is it in the europe region ?
    • Is the cluster properly deployed or you are experiencing any issue in the deployment of the cluster ?
    0 讨论(0)
  • 2021-01-23 09:26

    Turns out, my ISP blocks all connections to MongoDB for some reason. I haven't contacted them yet, but I find this very silly as I racked my brains out trying to solve this when the problem wasn't at all in my control.

    0 讨论(0)
  • 2021-01-23 09:42

    I also had this problem with Comcast Xfinity. DHCP sets DNS servers that would not lookup the mongodb connections. I'm running KDE Neon Linux (Ubuntu 18.04). In order to get things working I had to supersede the domain-name-servers supplied through comcast. I used Google's public DNS, but there are others that can be used. I had to edit (you'll need root permissions) the /etc/dhcp/dhclient.conf file, and added to following line: supersede domain-name-servers 8.8.8.8, 8.8.4.4; I hope this helps somebody, took me too long to figure it out. :-)

    I just found this post by M. Brandao with the fix for Windows users:

    1. Open the Control Panel.
    2. Click View network status and tasks
    3. Click Change adapter settings on the left portion of the window.
    4. Double-click the icon for the Internet connection you're using.
    5. Click the Properties button.
    6. Click and highlight Internet Protocol Version 4 (TCP/IPv4) and click Properties.
    7. If not already selected, select the Use the following DNS server addresses option.
    8. Enter the new DNS addresses (see above) and click OK and close out of all otherwindows.
    0 讨论(0)
提交回复
热议问题