# How to select certain country for exit node?

**URL:** https://forum.torproject.org/t/how-to-select-certain-country-for-exit-node/14080
**Category:** Tor Browser Desktop
**Tags:** tor-browser
**Created:** [August 14, 2024, 9:59am UTC](https://forum.torproject.org/t/how-to-select-certain-country-for-exit-node/14080 "2024-08-14T09:59:29Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![pxstein](https://forum.torproject.org/letter_avatar_proxy/v4/letter/p/b19c9b/32.png) [@pxstein](https://forum.torproject.org/u/pxstein)
#### Post date: [August 14, 2024, 9:59am UTC](https://forum.torproject.org/t/how-to-select-certain-country-for-exit-node/14080/1 "2024-08-14T09:59:29Z")

</div>

I want to use Tor Browser (on Windows 10). It works.  
However I found currently no way to define a certain country for the exit node.

How can I achieve this (in Tor Browser)?

---

<div class="post-metadata">

### Author: ![capole](https://forum.torproject.org/letter_avatar_proxy/v4/letter/c/f6c823/32.png) [@capole](https://forum.torproject.org/u/capole)
#### Post date: [August 14, 2024, 1:37pm UTC](https://forum.torproject.org/t/how-to-select-certain-country-for-exit-node/14080/2 "2024-08-14T13:37:01Z")

</div>

You need to modify your `torrc` and use `ExitNodes`.

It allows the use of fingerprints (if you want to use a specific exit relay) or country codes, which is what you are looking for.

Note the following warning from the man page:

> Note that if you list too few nodes here, or if you exclude too many exit nodes with ExcludeExitNodes, you can degrade functionality. For example, if none of the exits you list allows traffic on port 80 or 443, you won’t be able to browse the web.
> 
> – [torrc manpage](https://manpages.debian.org/bookworm/tor/torrc.5.en.html)

---

<div class="post-metadata">

### Author: ![BobbyB](https://forum.torproject.org/user_avatar/forum.torproject.org/bobbyb/32/5456_2.png) [@BobbyB](https://forum.torproject.org/u/BobbyB)
#### Post date: [August 14, 2024, 9:20pm UTC](https://forum.torproject.org/t/how-to-select-certain-country-for-exit-node/14080/3 "2024-08-14T21:20:24Z")

</div>

TLDR;

example: ExitNodes {fr} --\>France  
or ExitNodes {fr, de} → France or Germany

---

<div class="post-metadata">

### Author: ![pxstein](https://forum.torproject.org/letter_avatar_proxy/v4/letter/p/b19c9b/32.png) [@pxstein](https://forum.torproject.org/u/pxstein)
#### Post date: [August 15, 2024, 10:04am UTC](https://forum.torproject.org/t/how-to-select-certain-country-for-exit-node/14080/4 "2024-08-15T10:04:37Z")

</div>

Ok, thank you.  
I have read now some more information.

If I don’t want to change the torrc permanently I can pass a parameter like

tor.exe --ExitNodes “{ca}”

Is this the same for Torbrowser?

As I read -StrictNodes 1 is only a suggestion and refers only to ExcludeNodes

Is there really no way to enforce a certain country for ExitNodes ?

---

<div class="post-metadata">

### Author: ![capole](https://forum.torproject.org/letter_avatar_proxy/v4/letter/c/f6c823/32.png) [@capole](https://forum.torproject.org/u/capole)
#### Post date: [August 15, 2024, 10:52am UTC](https://forum.torproject.org/t/how-to-select-certain-country-for-exit-node/14080/5 "2024-08-15T10:52:14Z")

</div>

> [@pxstein](#):
>
> Is there really no way to enforce a certain country for ExitNodes ?

I don’t think it is needed, actually. `StrictNodes` is to prevent the creation of circuits with the nodes you exclude for circuits for Hidden Services, Self-tests and others.

If you set `ExitNodes {es}` (the country code for Spain) the connection to the Tor network will just fail, as there are no exits in Spain.

It is probably different from `ExcludeNodes`, as unless you use `StrictNodes`, circuits with excluded nodes will be created if necessary to prevent connection failures.

> [@pxstein](#):
>
> tor.exe --ExitNodes “{ca}”

No idea, as a Linux user, I like to tinker with configuration files. As for the changes being permanent… Well, luckily it’s just a matter of adding/changing/removing that one line.

Maybe someone else has the right answer.

---

<div class="post-metadata">

### Author: ![BobbyB](https://forum.torproject.org/user_avatar/forum.torproject.org/bobbyb/32/5456_2.png) [@BobbyB](https://forum.torproject.org/u/BobbyB)
#### Post date: [August 15, 2024, 11:27pm UTC](https://forum.torproject.org/t/how-to-select-certain-country-for-exit-node/14080/6 "2024-08-15T23:27:22Z")

</div>

The easiest is to edit the torrc file with a text editor and add or change the line ExitNodes {ca} then start the browser. I do it all the time when I want a specific exit node or remove it when I use to use whatever comes.

The Tor browser starts tor.exe with whatever parameters it uses.

You could make a batch file to first spit out a torrc file to use with the exit node of choice then start the Firefox browser with whatever is in your shortcut on the desktop.  
Now this batch file can be as simple or sophisticated as you want.

I would first make a copy of the current torrc file without exitnode as torrcCOPY (Remember, this is Windows. Case is not sensitive in filenames and commands. It’s just to make things more readable.)  
Change **YOURnameHERE**  
There is an intentional blank after: **Enter 2 Character Country Code:**

**-----EXAMPLE:**  
@echo off  
setlocal  
SET /P CC=Enter 2 Character Country Code:  
copy “C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrcCOPY” “C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrc” \>NUL  
echo ExitNodes {%CC%} \>\>“C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrc”  
endlocal  
“C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\firefox.exe”  
**-----ENDEXAMPLE:**

**DISCLAIMER:** Supplied as is. Tested and works for me. 🙂

**EDITED LATER:**  
The original script fails to take into account the occasion where you **do not** want a specific exit node.  
The script is now modified to this:

@echo off  
copy “C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrcCOPY” “C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrc” \>NUL  
setlocal  
SET /P CC=Enter 2 Character Country Code:  
if .%CC% == . GOTO none  
echo ExitNodes {%CC%} \>\>“C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrc”  
endlocal  
:none  
“C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\firefox.exe”  
😉

---

<div class="post-metadata">

### Author: ![BobbyB](https://forum.torproject.org/user_avatar/forum.torproject.org/bobbyb/32/5456_2.png) [@BobbyB](https://forum.torproject.org/u/BobbyB)
#### Post date: [August 19, 2024, 5:19am UTC](https://forum.torproject.org/t/how-to-select-certain-country-for-exit-node/14080/7 "2024-08-19T05:19:41Z")

</div>

**Another error**. It should look like this:

@echo off  
copy “C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrcCOPY” “C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrc” \>NUL  
setlocal  
SET /P CC=Enter 2 Character Country Code:  
if .%CC% == . GOTO none  
echo ExitNodes {%CC%} \>\>“C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrc”  
:none  
endlocal  
“C:\Users\YOURnameHERE\Desktop\Tor Browser\Browser\firefox.exe”
