How does Facebook know my location when I'm using a VPN?

Hi and thank you in advance for helping. This is my first post here and I found it a bit overwhelming. Hope I’m doing this correctly:

Ubuntu Version:
Lubuntu 24.04LTS

Desktop Environment (if applicable):
Not sure, whatever the default desktop is for Lubuntu. LXQt, maybe?

Problem Description:
I am running a VPN, and have modified my Firefox browser’s about:config geolocation to use a different Lat and Long than my home. Yet many sites still ping me with “Suspicious login from XYZ location (which is the town I live in).” I’ve seen this on Facebook, on Chess.com, and several other sites. I also have “Do Not Track” set in the Firefox browser preferences. I’m baffled as to how sites are finding my location so easily and wonder what I can do to further close leaks.

I’m TERRIBLY sorry if this isn’t the right forum (or the right “Discourse”) to ask this, but I found it very very hard to find my way around this new forum (Ubuntu Forums was vastly easier). Please know that I’m not trying to spam and I do realize that this might not be specifically an Ubuntu issue.

Relevant System Information:
Firefox 134.0.2 for Linux, Lubuntu 24.04LTS

Thank you!

What type of VPN commercial or home spun?

A lot of the big Sites use WiFi location. Maybe a DNS leak.

Do you use Facebook?

Thank you for the reply. It’s a commercial VPN and when I use “WhatsMyIP” it shows it nicely far from where I am. Yes, I use Facebook (that’s part of the question, how does FB know?), and I am on a landline connection, not Wifi.

I’m not a social media type person, And no Facebook for myself.

If you have WiFi at all they know.
Another possible is your login details.
Have you checked for any Leaks in your DNS yet?
And are those 2 sites you mention the only 2 that show your location.
And lastly you could open a ticket with your VPN provider to help.

One more thing I like to do as I don’t need it yet is disable IPv6.

Likewise. I can suggest Proton VPN.
I use Proton Mail and Proton VPN and Proton Pass.

I’d love to know more about the “how” in some of these. How does having wifi “at all” enable a computer to bypass a VPN? (It’s my desktop that I’m working on, which doesn’t even have a wifi card. My phone of course has wifi. But when I log in from my desktop, I get a message “suspicious login from XYZ on a Firefox browser with Linux.”

I have checked the DNS with “www.dnsleaktest.com” and it seems to find my actual IP address, rather than the one of my VPN. Which certainly is problematic. But I don’t know why. When I use the “standard” or “extended” test, it shows only my VPN’s IP.

I’m only sharing possibilities, but with no ability to have WiFi, We can rule that out, I never said By-pass… and you found your why by the DNS Leask test. But they really can know about every NIC you have. Do a “ip a” in your terminal.

I really encourage you to open a support ticket with your VPN-provider with your personal findings.

The “ip a” in the terminal doesn’t show any matching IP address to what I’m seeing at the “whatsmyip” site. Interesting.

One big cause of DNS leaks is WebRTC. Make sure media.peerconnection.enabled is set to false. Of course, this will eliminate the option to do e.g. videoconferencing in the browser.

Do you use FB , Messenger or IG on other devices like your phone?

Do your FB friends post updates and status that might reveal your location?

Have you bought something on market place?

In a lot of these cases the reasons are often not technical.

Also see this post on Reddit by fogcitynative

Blockquote A VPN only hides the location of your ISP and local server, by inserting their server between you and the site. A VPN does nothing about Geolocation, and it is Geolocation that is giving up your real location. Try IPLEAK.NET, make sure you have no DNS leaks, no web RTC leaks, and that your Geolocation isn’t showing where you really are.

https://www.reddit.com/r/VPN/comments/o3x0d2/how_come_facebook_knows_your_real_location_after/

1 Like

Facebook knows your phone number. The area code will give out your city. That’s probably why.