Getting IP addresses from a specific country

Is it possible to make Tor connect only to nodes in a specific country? For example, configure the Tor to connect only to nodes in Italy.

Thank you.


Yes! In the file torrc, add the following line before the line starting with GeoIPFile. Don’t know where this is in Linux or if it is called the same. In Windows it is in folder: \Desktop\Tor Browser\Browser\TorBrowser\Data\Tor

ExitNodes {it}

Thank you so much for your reply.
In Linux, I can’t see any GeoIPFile line in /etc/tor/torrc file!

Remember that my post was from a Windows point of view. Linux does things differently.
Bottom line: Does it work?

Hard to find all this documentation. I forgot where I found this stuff.

1 Like

@hack3rcon based on what I read on the internet, and as already suggested, you should add ExitNodes {it} somewhere in the /etc/tor/torrc file.
As @BobbyB mentioned, just try it and check if it works.

This might also help:

FYI, this is TOR official position on this subject:

"Can I pick which country I’m exiting from?

Modifying the way that Tor creates its circuits is strongly discouraged. You get the best security that Tor can provide when you leave the route selection to Tor; overriding the entry/exit nodes can compromise your anonymity. If the outcome you want is simply to be able to access resources that are only available in one country, you may want to consider using a VPN instead of using Tor. Please note that VPNs do not have the same privacy properties as Tor, but they will help solve some geolocation restriction issues."

1 Like

Thank you so much for your reply.
Have you tested this yourself?

Hi @hack3rcon, I haven’t tested it myself, because I don’t need those settings.

1 Like


I understand your question in the way to have e.g. all 3 hops (the guard, middle and exit) in one country. The Tor path selection spec has nothing against it (see chapter 2).

But in torrc I think only Guard and Exit can be user selected. The middle hop is not free of choise. In the case of Italy the probability is not very high for an italien Middle.

To play with a Tor client, search for the file pattern torrc and geoip/geoip6 on your Windows machine. Please read the manuals how to use it.

Please treat this testing as an experment and do not rely on proper and safe function until you are very sure about it.

I hope that helps and enjoy hacking!

Cheers, Felix