I can not connect my mongodb compass with my cluster

Please post a screenshot of the DNS configuration you tried.

Hi Steevej,
Can you show me the screen shot of google dns connection.
I really don’t know where I replace google dns.
Please Help!!!

I used this connection string:
mongodb+srv://hellojesus1:qNgKFnnczkiIShHP@jvuwithjesus.ygys3.mongodb.net/jesusdatabase?retryWrites=true&w=majority
but it doen’t work.
Please help!!!

Check this link

Long form of connect string you can get from your Atlas account.Choose old version of shell

Is password given in your connect string correct?
I am getting different error

2022-05-21T16:43:41.648+0530 I NETWORK [js] Marking host jvuwithjesus-shard-00-02.ygys3.mongodb.net:27017 as failed ::
caused by :: Location40659: can’t connect to new replica set master [jvuwithjesus-shard-00-02.ygys3.mongodb.net:27017],
err: Location8000: bad auth : Authentication failed.

1 Like

This is my creen shot of network ip:

IP Address Comment Status Actions
8.8.8.8/32 Active EDIT DELETE
0.0.0.0/0 (includes your current IP address) Active EDIT DELETE
8.8.4.4/32

This is not your DNS server setting. It is your Atlas network access list. Go to the Google Developers link provided by @Ramachandra_Tummala and follow the instructions to change your DNS settings.

Alternatively, do as suggested by @Ramachandra_Tummala and use the Long form.

Hi Steevej,
I already connected your DNS settings 8.8.8.8 and 8.8.8.4 but It did not work and I could not use my internet to access any websites.
Is there other ways?
Please help!!!

Did you do the dns settings on your laptop/pc from network-adapter?

Did you try long form(old style) connect string method?
From your Atlas account choose connect to shell and select old shell version in drop down
What other options you see in your Compass?
Does fill individual fields option exist?

It is 8.8.4.4 and please help us help you by providing

I do not see where you specified 8.8.8.8 or 8.8.4.4

That’s the correct DNS. But your previous screenshot shows that you are not using this Wi-Fi network interface. You have to set the DNS on the network interface you are using.

Hi Steevej,
I really don’t understand what you mean about network interface. Can you give an example or explainations about it.
Thanks for your time.
Please help!!!

Sorry for the confusion, I always forget that Windows is using Network Connections rather than network interface.

In the image at I can not connect my mongodb compass with my cluster - #16 by Jimmy_h_Vu, with Control Panel > Network and Internet > Network Connections, you have 3 icons. One of them is partly covered by the dialog Ethernet Properties. The other 2 are labeled McAfee VPN and Wi-Fi. For the McAfee VPN the status shows a big red X with Network cable unplugged. The Wi-Fi one also show a big red X with Not connected.

In the other image at I can not connect my mongodb compass with my cluster - #18 by Jimmy_h_Vu, you show the DNS setting Network & internet > Wi-Fi > Wi-Fi but you are Not connected via that connection as explained in the previous paragraph.

This means you DID NOT changed the DNS setting of the network connection you are using.

The solution is to change the DNS setting of the network connection you are using to connect to your cluster.

1 Like

Hi Steeve,
Thanks for your Information and I have connected mongodb compass with the cluster.
but
I have another problem to connect my application with the cluster.

my server.js

const express = require("express");

const mongoose = require("mongoose");

const cors = require("cors");

const { readdirSync } = require("fs");

const dotenv = require("dotenv");

dotenv.config();

const app = express();

app.use(cors());

//routes

readdirSync("./routes").map((r) => app.use("/", require("./routes/" + r)));

//database

mongoose

  .connect(process.env.DATABASE_URL, {

    useNewUrlParser: true,

  })

  .then(() => console.log("database connected successfully"))

  .catch((err) => console.log("error connecting to mongodb", err));

const PORT = process.env.PORT || 8000;

app.listen(PORT, () => {

  console.log(`server is running on port ${PORT}..`);

});
  • The terminal errors:
server is running on port 8000..
error connecting to mongodb MongoParseError: mongodb+srv URI cannot have port number
    at new ConnectionString (C:\Users\vujim\OneDrive\Desktop\jvuwithjesus\backend\node_modules\mongodb-connection-string-url\lib\index.js:146:23)
    at parseOptions (C:\Users\vujim\OneDrive\Desktop\jvuwithjesus\backend\node_modules\mongoose\node_modules\mongodb\lib\connection_string.js:213:17)
    at new MongoClient (C:\Users\vujim\OneDrive\

************Please help!!!

If you have linux or cygwin you can use the following:
dig +all vuwithjesus.ygys3.mongodb.net

; <<>> DiG 9.10.6 <<>> +all vuwithjesus.ygys3.mongodb.net

;; global options: +cmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 25811

;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

;; OPT PSEUDOSECTION:

; EDNS: version: 0, flags:; udp: 4096

;; QUESTION SECTION:

;vuwithjesus.ygys3.mongodb.net. IN A

;; AUTHORITY SECTION:

mongodb.net. 900 IN SOA ns-761.awsdns-31.net. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 60

;; Query time: 122 msec

;; SERVER: 10.0.0.138#53(10.0.0.138)

;; WHEN: Sun May 29 12:35:21 IDT 2022

;; MSG SIZE rcvd: 153

if the DNS resolves correctly then you still need the right username and password, but at least you are knocking at the right door!

1 Like

The error message is

The error is in your URI. You have to share your URI for us to help you figure out what is wrong.

1 Like


That work fine for me

I too facing this issue