Reputation: 39
I am trying to connect Mongodb Atlas cluster to Studio 3t.
I copied mongodb+srv://:@cluster0-ohzuo.mongodb.net/test from Mongodb account in "connect to cluster"
In Studio 3t,I went to connection manager > new connection > Import URI and pasted the above string.
I am getting the following error : Failed to import the URI. Unable to look up TXT record for host cluster0-ohzuo.mongodb.net
Upvotes: 3
Views: 2542
Reputation: 5902
For someone else in future having similar issue
Yes to overcome this, you have to add a DNS route
System.setProperty("java.naming.provider.url", "dns://8.8.8.8");
Also, mentioned in this article: https://www.mongodb.com/developer/products/atlas/azure-functions-mongodb-atlas-java/#connecting-the-serverless-function-with-mongodb-atlas
Upvotes: 1
Reputation: 63
I solved the problem by changing the Java version in the connection method from "3.7 or later" to "3.4 or later":
Upvotes: 6