MongoDB.live, free & fully virtual. June 9th - 10th. Register Now

Whitelist my IP Address in Network Access not working

Hi all,

I’ve whitelist only my IP address and my application couldn’t connect to mongod atlas.

But if I’ve whitelist ‘Allow from anywhere’, it works perfectly which is not my intention to ‘Allow from anywhere’.

How do I make only my IP address works? I’ve tried added both public and private IPv4 address and it still doesn’t work.

Please help. Thank you.

First, if you can connect when Allow from anywhere, then the cluster is working file. That’s good to know.

If you cannot connect when you white list your address, then probably you do not white list the correct address. If you have a VPN you must white list the address of the VPN that connects to the non-VPN part of the world. If you are behind a NAT network you must white list the address of the last gateway. You may try
dig +short myip.opendns.com @resolver1.opendns.com to get your visible IP. The site https://whatismyipaddress.com/ may also provide you with this information.

1 Like

I’m not using any VPN. I’m not using NAT network but I’m not sure if my ISP is using NAT network.
I’ve used the public address from ‘https://whatismyipaddress.com/’ but I couldn’t connect except 0.0.0.0 ‘Allow from anywhere’.

I don’t have dig in my git bash windows.

Do the same thing with nslookup. No web proxy either ?

If ‘add this ip address’ doesn’t work then it is likely your ISP is doing some nasty.

nslookup myip.opendns.com resolver1.opendns.com

1 Like

Also powershell version:

Resolve-DnsName -Server resolver1.opendns.com myip.opendns.com

Server: [resolver1.opendns dot com]
Address: 208.67.xxx.xxx

Non-authoritative answer:
Name: [myip.opendns dot com]
Address: 112.199.xxx.xxx

I have two different IP address. What does this means?
I’ve whitelist 112.199.xxx.xxx but not the one above.

Did Window shell
Only 1 row appear. Resolver1 is not appearing.
Name Type TTL Section IPAddress


myip.opendns.com A 0 Answer 112.199.xxx.xxx

The first address from nslookup is the ip addres of resolver1.opendns.com.

Yes the 112.199.xxx.xxx is the one you are interested in.

If that is the one that you’ve whitelisted and it doesn’t work, you should have a chat with your ISP.

The connecting IP would be in mongo logs. But not available in Frre/Shared Tiers

Feature unavailable in Free and Shared-Tier Clusters
This feature is not available for M0 (Free Tier), M2 , and M5 clusters. To learn more about which features are unavailable, see Atlas M0 (Free Tier), M2, and M5 Limitations.