How to Set Tor Exit Nodes to a Specific Country

It is entirely possible to configure the Tor network to route your internet traffic exclusively through exit nodes located in a specific country. By modifying the core Tor configuration file, known as torrc, you can specify target countries using two-letter ISO country codes and force the client to strictly adhere to those geographical parameters. This guide outlines the exact configuration directives required, how to apply them, and the privacy implications of doing so.

Step 1: Locate the torrc File

To change your exit node settings, you must first locate and edit the torrc configuration file on your system.

Step 2: Add Country Directives

Open the torrc file in a standard plain-text editor (such as Notepad, TextEdit, or Nano). Scroll to the bottom of the file and add the following lines:

ExitNodes {cc}
StrictNodes 1

Replace {cc} with the two-letter ISO 3166-1 alpha-2 code of your desired country (enclosed in curly braces).

Examples:

Understanding the Directives

Step 3: Apply and Verify

  1. Save the changes to the torrc file.
  2. Restart the Tor Browser or the Tor daemon service (sudo systemctl restart tor on Linux).
  3. Visit an IP verification site (such as check.torproject.org or any standard geolocation service) to confirm that your exit IP address is registered to the chosen country.

Important Security Considerations

Restricting your exit nodes to a single country limits the size of the relay pool available to your client. This can reduce your overall anonymity by making traffic analysis easier for network-level adversaries. Additionally, if the specified country has limited Tor exit capacity, you may experience slower browsing speeds or connection failures.