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 fact-checked, ensuring the accuracy of any cited facts and confirming the authority of its sources.
This article has been viewed 1,145,970 times.
Learn more...
When you use Tor to browse the web, your connection to the site is passed through random IP addresses based in various 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 specific location, you can add custom entry and exit nodes to your configuration file. It's better to use a VPN to fake your location, but Tor will work if you don't have one. This wikiHow teaches you how to change your country in the Tor web browser on Windows, Mac, and Linux.
Quick Steps
- Open the “torrc” file in a text editor.
- On the first empty line, type: EntryNodes {} StrictNodes 1
- On the next line, add: ExitNodes {} StrictNodes 1
- Type the country's two-letter code (e.g., CA for Canada) into the brackets.
- Save and exit the file, then restart Tor.
Steps
-
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.
- Not all sites and regions permit traffic from Tor, so you may not be able to access all websites using the browser.
- The Tor Project does not recommend changing your configuration to specify a country, as this could compromise your anonymity.[1] The best way to spoof your country is to use a VPN.
-
Navigate to the "torrc" file. The location of the Tor configuration file varies depending on where you installed the app:
-
Windows
- The default installation location for Tor is a file called "Tor Browser" on your desktop. The torrc file is located in the Browser/TorBrowser/Data/Tor within that "Tor Browser" folder.
- To get there, double-click Tor Browser on your desktop, double-click the Browser folder, double-click TorBrowser, double-click Data, then double-click Tor.
-
Linux
- The default install location is a folder called "Tor Browser" on the desktop.[2] Double-click the Tor Browser folder to open it, double-click the Browser folder, double-click TorBrowser, double-click Data, then double-click Tor.
- If you don't see such a file, you can use the find command to locate it.
-
Mac
- The default location for the torrc file is inside ~/Library/Application Support/TorBrowser-Data/Tor.
- To get there, open Finder, press Command + Shift + G, and enter or paste this address into the field: ~/Library/Application Support/TorBrowser-Data/Tor.[3] Click Go to open the folder.
Advertisement -
Windows
-
Open 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).
-
Find a country with Tor nodes. To set Tor to a specific country, you'll need to make sure there are nodes available in that country. Go to https://metrics.torproject.org/rs.html#advanced, select a country from the "Country" menu, and click Advanced Search. If a list of nodes appears, you can use that country as your location.
- If only a couple of nodes are in that country, you might want to repeat the search for some backup countries to use. You can enter multiple countries, so if no nodes are available in your preferred country, Tor will use the next country on the list.
- Not all countries have Tor nodes. If you see "No Tor relays matched your query", there are no nodes in that country.
- Make note of the country's two-letter code, which appears after "country:" in the search box at the top-right corner of the Relay Search page—for example, FR for France and MD for Moldova. You'll need this code when setting your country.
-
Add the
EntryNodes
andExitNodes
lines to your torrc file.- On the first empty line, type
EntryNodes {} StrictNodes 1
. - On the next empty line, type
ExitNodes {} StrictNodes 1
.
- On the first empty line, type
-
Enter your country code(s) into the brackets. Inside the curly brackets {}, type the code for the country you want websites to think you're in.
- For example,
ExitNodes {eg} StrictNodes 1
means Tor will only use the country "eg" (Egypt) as an exit node, forcing your traffic to be routed through one of Tor's Egyptian exit nodes.
- For example,
-
Add multiple countries. If you only enter one country code as your entry and exit nodes, that will be the only country through which your connection is routed. That can cause problems if no nodes are available in your chosen country when you want to connect. It's best to add multiple countries, especially if few nodes are available in your preferred country. To do this, enter more country codes inside of the brackets, separating 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.
-
-
Consider disabling strict nodes. The "StrictNodes 1" value means 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
withStrictNodes 0
to ensure that Tor can still use other countries' codes if those specified aren't working. -
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 press Ctrl + S to save.
-
Open Tor and visit a website. Go to any website (e.g., 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, middle, and exit nodes, which should match what you entered into the file.
- The Exit Node is the country the website thinks you're in.
Community Q&A
-
QuestionWhat about Linux?Community AnswerEdit /etc/tor/torrc.
-
QuestionHow do I make the last IP in the node be from a specific country?Community AnswerOpen 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}.
-
QuestionHow do I make Tor select a specific state in a country, like California?Community AnswerYou cannot. You can only select a specific country.
Tips
-
If you're having trouble connecting to websites, click the hamburger menu in the upper-right corner of Tor and select New Tor circuit for this site.Thanks
-
If an exit or entry node is not accepting connections on the port you're using (for example, port 443 if you're connecting to a secure website), you won't be able to connect to that site.Thanks
Tips from our Readers
- Consider making a backup of torrc before editing. This will make it easier to revert to the default configuration when you no longer want to use those country settings.
Warnings
- While changing the exit and entry nodes to specific regions can effectively make certain websites show you content it wouldn't otherwise, it can prevent Tor from effectively protecting your anonymity. This may not concern you if you're just watching YouTube videos. However, if you really need to stay anonymous, Tor recommends using their default settings.[4]Thanks
References
About This Article
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.