Error: queryTxt ETIMEOUT cluster0.xxxxxxx.mongodb.net
at QueryReqWrap.onresolve [as oncomplete] (node:internal/dns/promises:252:17) {
errno: undefined,
code: 'ETIMEOUT',
syscall: 'queryTxt',
hostname: 'cluster0.xxxxxxx.mongodb.net'
}
when i connect to my atlas it giving this error and i have no idea what its about so i cant debug it, it just happened suddenly coz it was working okay before all this
here is how am connecting to the atlas:
const connect = async () => {
try {
await mongoose.connect(process.env.MONGODB_URI, {
useNewUrlParser: true,
useUnifiedTopology: true,
});
console.log('Connected to mongoDB Atlas!');
} catch (error) {
console.log(error);
}
};
connect().then(() => {
try {
app.listen(process.env.PORT, () => {
console.log(`Server running on port ${process.env.PORT}`);
});
} catch (error) {
console.log(error);
}
});
here is my URI:
MONGODB_URI = mongodb+srv://yyyyyyyyy:xxxxxxxxxx@cluster0.gdrr9qe.mongodb.net/?retryWrites=true&w=majority