How do I fix the "DNSHostNotFound Failed to look up service" error?

Validated on 20 Nov 2024 • Last edited on 6 Dec 2024

When connecting to a MongoDB managed database from your local machine, you may get the following error:

DNSHostNotFound: Failed to look up service “_mongodb._tcp.<MongoDB hostname>”

This error can occur when you use your internet service provider’s default DNS server, which might not support the SRV lookups used by the DNS seed list connection string format.

To fix this error, you can try using a public DNS server, such as Google’s 8.8.8.8, instead.

How do I fix the "Invalid Parameters and Values" error when connecting to my database?

Verify the format and values in the connection string for typos or formatting errors.

How do I fix the "No Such File or Directory" error when connecting to my database?

Prepend your database client command to the connection string.

How do I fix the "Cannot create property _id on string" type error?

Remove the _id field from your JSON data so MongoDB can automatically generate unique _id values for each document during import.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.