Aparajita Subramanyam
Aparajita Subramanyam

Reputation: 39

Failed to import the URI. Unable to look up TXT record for host cluster0-ohzuo.mongodb.net

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

Answers (2)

Code_Life
Code_Life

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");

Like this: https://github.com/mongodb-developer/starter-azure-function-mongodb/blob/c8c8a1f52d145450349a9a710eb3825237c7c3f0/src/main/java/org/mongodb/functions/Movies.java#L37

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

Andrey Frolov
Andrey Frolov

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":

Open connect

Select 3.4 or later java version

Upvotes: 6

Related Questions