Cannot connect to MongoDB Atlas Cluster: DNSHostNotFound

后端 未结 3 773
傲寒
傲寒 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: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.

提交回复
热议问题