Failed to connect to cluster using a .env file

Hello everyone, I am following this YouTube Video guide here. All steps up to connecting to the Mongo DB work. I constantly get the below error:

MongoError: failed to connect to server [] on first connect [Error: getaddrinfo ENOTFOUND
    at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:118:26) {
  name: 'MongoError'
}] did not connect
[nodemon] clean exit - waiting for changes before restart

For the life of me I cannot seem to get anything to work. I cannot ping the cluster, I have tried 4 different wifi networks, phone hotspot, liabry internet, home wifi, work wifi, and nothing! I’ve disabled my mac’s firewall to try to get it to work, port forwarded “1337”, “27016”, “27017”.
Below is a copy of my code I want to work:

import express from "express";
import bodyParser from "body-parser";
import mongoose from "mongoose";
import cors from "cors";
import helmet from "helmet";
import morgan from "morgan";
import dotenv from "dotenv";
/* Configurations (mainly used as a boiler plate to config these packages in the long run m*/
const app = express();
app.use(helmet.crossOriginResourcePolicy({ policy: "cross-origin" }));
app.use(bodyParser.urlencoded({ extended: false }));

console.log("Hello World");
/* Mongoose SETUP */
const PORT = process.env.PORT || 9000;
console.log("Port from ENV", PORT);

    .connect(process.env.MONGO_URL, {
        useNewUrlParser: true,
        useUnifiedTopology: true,
    .then(async () => {
        app.listen(PORT, () => console.log(`Server is running on port ${PORT}`));
    .catch((error) => console.log(`${error} did not connect`));

Below is a copy of my .env file, with sensitive info removed for this forum:


And yes I’ve turned off my Laptop’s firewall, and my my router’s firewall, allowed all IPs on MongoDB, still no working connection

Disappointed in this ‘support’ community, not a single comment to help me, quite annoyed to be frank.