When you use Tor to browse the web, your connection to the site is passed through random IP addresses based in any number of countries. This is great for keeping your real location private, but unhelpful if you want to visit a website that only allows connections from a particular country. If you want the sites you browse to think you're connecting from a certain location, you can add custom entry and exit nodes to your configuration file. It's a better idea to use a VPN to fake your location, but Tor will work if you don't have one. This wikiHow teaches you how to set custom exit and entry nodes in the Tor web browser using Windows, macOS, and Linux.

Steps

  1. 1
    Open Tor at least once. You'll need to run Tor at least once to create the file you'll be editing. Just double-click the Start Tor browser icon in the folder where you've installed Tor and click Connect at least one time.
    • If you've already started Tor, close it—you'll need to make sure the app is closed so you can effectively edit the configuration file.[1]
    • Keep in mind that not all sites and regions permit traffic from Tor, so you may not be able to access all websites using the browser.
  2. 2
    Open the Tor folder. If you're using Windows or Linux, the location varies depending on where you installed the app. On Linux you may try to use commands locate torrc and find / torrc. If you're using a Mac, you'll actually need to open a different folder:
    • Windows and Linux: The default install location for Tor is the desktop on both operating systems.[2] Double-click the Tor Browser folder to open it.
    • Mac: Open Finder, press Command + Shift + G, and enter or paste this address into the field: ~/Library/Application Support/TorBrowser-Data .[3] Click Go to open the folder.
    Advertisement
  3. 3
    Navigate to the "torrc" file. This is the configuration file you'll need to edit. To find it:
    • Windows and Linux: Double-click the Browser folder, double-click the TorBrowser folder, double-click the Data folder, and then double-click the Tor folder.
    • Mac: Just double-click the Tor folder.
  4. 4
    Open the file called torrc in a text editor. To do this, double-click the file. If it doesn't automatically open a text editor, you'll be prompted to choose one (e.g., Notepad for Windows or TextEdit for macOS).
  5. 5
    Add the EntryNodes line. Place your cursor below the last line of text in the document, then type in EntryNodes {} StrictNodes 1 and press Enter or Return to go to the next line.

    Doing this step may not be necessary if all you want to do is set a specific exit node, the one whose IP address will be shown to the services you connect to.

  6. 6
    Add the ExitNodes line. Type in ExitNodes {} StrictNodes 1 onto the next line.
  7. 7
    Find your entry and exit country codes. Go to https://www.iso.org/obp/ui/#search in your web browser and write down the 2-digit code for the country you're pretending to be in. You can add multiple countries if you'd like.
    • For example, if you want your Tor browsing session to start in Canada and exit in Egypt, you would look for the "Canada" country code (ca) and the "Egypt" country code (eg).
    • Not all countries have Tor entry and exit nodes. After finding a code, go to https://metrics.torproject.org/rs.html, type country:eg (replace eg with the country code you want to look up), and click Search to find out if Tor has any relays there.
  8. 8
    Enter your entry and exit country codes. Type the code for the country in which you want your session to start in between the {} curly brackets to the right of the "EntryNodes" line, and then repeat with the exit country and the "ExitNodes" line. For example, to enter in Canada and exit in Egypt, your lines might look like this:
    • EntryNodes {ca} StrictNodes 1
    • ExitNodes {eg} StrictNodes 1
  9. 9
    Consider disabling strict nodes. The "StrictNodes 1" value means that Tor will not try to use countries other than those you've specified. However, it also means that if no nodes are available in the regions you entered, you won't be able to make the connection. You can replace StrictNodes 1 with StrictNodes 0 to ensure that Tor can still use other countries' codes if those specified aren't working.
  10. 10
    Add multiple country options to a strict node. If you do want to keep strict nodes enabled for your entry and/or exit nodes, consider adding multiple countries rather than just using one country. You can add countries by adding more country codes inside of brackets, making sure to separate them with commas. For example, to add Canada, Egypt, and Turkey to the "ExitNodes" line, you would have the following line:
    • ExitNodes {ca},{eg},{tr} StrictNodes 1
      • Make sure there are no spaces between bracketed countries.
  11. 11
    Save and exit the file. If you're using Windows or macOS, just click File, select Save, and exit the app. Saving the file in Linux depends on which text editor you're using. If you're using a graphical text editor, you can usually just press Ctrl + S to save.
  12. 12
    Open Tor and visit a website. Go to any website (e.g., https://www.wikihow.com/) in Tor, and then click the padlock icon on the address bar at the top of the browser. Now you'll see the entry node, the middle nodes, and the exit node, which should match what you entered into the file.
  13. Advertisement

Community Q&A

  • Question
    What about Linux?
    Community Answer
    Community Answer
    Edit /etc/tor/torrc.
  • Question
    How do I make the last IP in the node be from a specific country?
    Community Answer
    Community Answer
    Open the folder where you have installed Tor, browse through browser > Tor browser > Tor > data. There you will find a file named "torrc." Open the file with Notepad. At the end of the document, on a new line, write this: ExitNodes {US}. For example, if you want your exit node to be in China, type {CN}.
  • Question
    How do I make Tor select a specific state in a country, like California?
    Community Answer
    Community Answer
    You cannot. You can only select a specific country.
Advertisement

About This Article

Nicole Levine, MFA
Written by:
wikiHow Technology Writer
This article was co-authored by wikiHow staff writer, Nicole Levine, MFA. Nicole Levine is a Technology Writer and Editor for wikiHow. She has more than 20 years of experience creating technical documentation and leading support teams at major web hosting and software companies. Nicole also holds an MFA in Creative Writing from Portland State University and teaches composition, fiction-writing, and zine-making at various institutions. This article has been viewed 885,462 times.
How helpful is this?
Co-authors: 18
Updated: March 7, 2023
Views: 885,462
Categories: Internet Browsers
Article SummaryX

1. Open Tor at least once and then close it.
2. Open the "torrc" file in a text editor.
3. Add the code to specify specific countries.
4. Save the file and restart Tor.

Did this summary help you?
Advertisement