How to connect from a specific country, without any VPN but privately enough through the TOR browser, benefits, and list of country codes?

Abhishek Kotecha
9 min readMay 1, 2020

--

Tor is a famous name when it comes to going anonymous on the www internet. Tor browser uses the modified Firefox underneath, with many out-of-the-box anonymity features and configurations, packaged together.

Tor is free and open-source software for enabling anonymous communication.

The tag line of www.torproject.org website reads as: “Defend yourself against tracking and surveillance. Circumvent censorship. | Anonymity Online.”

In case you do not have the TOR installed, you can download it from here and install it on your machine. It is available for Windows, Mac OS X, and Linux. It is also available for Android via Google Play.

Table of Content

  1. Benefits (why change the country)
  2. How to change the country (in Tor)
  3. Country codes

1. Benefits

Tor already is a powerful tool for online anonymity, then why does it make sense to change the country?

Well, below are some of the benefits, I am noting down, which should encourage you to change the country of source in Tor (or at least consider changing it in the future).

  1. Many of the websites only offer some content in a particular region or country.
    For example, searching for marijuana might be a crime in India but might not be of any offense in Colombia.
  2. Few of the video streaming services are tuned better for a specific country and may offer the least latency to the same country.
    For example, if a Sport is played in England, then connecting from the England node would be much faster than the traffic coming via Australia.

2. Change Country Code

Once you have the Tor browser installed on your machine, perform this step.

First, we need to locate a file called torrc. This file contains configuration instructions for how your Tor program should behave.

2.1 Locate the file

On Windows or Linux, the torrc file should be in the data directory, which is ../Browser/TorBrowser/Data/Tor inside your Tor Browser directory. In the below Gif, I am looking at the easiest way to find the file in Windows 10.

Probably, the best way to quickly get the torrc file in Windows.

If you’re on macOS, the torrc file is inside the data directory. You can find it at ~/Library/Application Support/TorBrowser-Data/Tor. Just press cmd-shift-g while in Finder and copy/paste that directory into the box that appears.

Finding the location in Mac OS X.

2.2 Update the file

Go to the last line of your torrc file and add the below two lines.

ExitNodes {cc1}
StrictNodes 1
// Replace cc1 with your country code.

Here, “in” is the country code. You may want to replace it with your country code. The list of the country code is given here for reference in the next section List of all country codes.

In case you want to use two different country codes, you can do that by comma separating the country codes.

ExitNodes {cc1},{cc2},{cc3}
StrictNodes 1
// Replace cc1, cc2, cc3 with your country code. There is no space between the commas.

In case you may never want to connect to a country, you can do that by below command. It will add that country to the blacklist.

ExcludeExitNodes {cc1}// Replace cc1 with your country code.

Once you’ve updated your torrc file, it is better to restart the application/service.

2.3 Example

In my case, below is the configuration at the end of the first three lines in the torrc file.

Here, my Tor browser will connect from either India, UK, USA, or Ireland. But it would never connect from Uganda or Pakistan.

ExitNodes {in},{uk},{us},{ie}
ExcludeExitNodes {ua},{pk}
StrictNodes 1

3. Country Codes

Below is the list of country codes that you can replace against the cc1, cc2, cc3, etc. on the above section/commands in the torrc file.

+---------------------------------------+------+
| Country | Code |
+---------------------------------------+------+
| ASCENSION ISLAND | {ac} |
| AFGHANISTAN | {af} |
| ALAND | {ax} |
| ALBANIA | {al} |
| ALGERIA | {dz} |
| ANDORRA | {ad} |
| ANGOLA | {ao} |
| ANGUILLA | {ai} |
| ANTARCTICA | {aq} |
| ANTIGUA AND BARBUDA | {ag} |
| ARGENTINA REPUBLIC | {ar} |
| ARMENIA | {am} |
| ARUBA | {aw} |
| AUSTRALIA | {au} |
| AUSTRIA | {at} |
| AZERBAIJAN | {az} |
| BAHAMAS | {bs} |
| BAHRAIN | {bh} |
| BANGLADESH | {bd} |
| BARBADOS | {bb} |
| BELARUS | {by} |
| BELGIUM | {be} |
| BELIZE | {bz} |
| BENIN | {bj} |
| BERMUDA | {bm} |
| BHUTAN | {bt} |
| BOLIVIA | {bo} |
| BOSNIA AND HERZEGOVINA | {ba} |
| BOTSWANA | {bw} |
| BOUVET ISLAND | {bv} |
| BRAZIL | {br} |
| BRITISH INDIAN OCEAN TERR | {io} |
| BRITISH VIRGIN ISLANDS | {vg} |
| BRUNEI DARUSSALAM | {bn} |
| BULGARIA | {bg} |
| BURKINA FASO | {bf} |
| BURUNDI | {bi} |
| CAMBODIA | {kh} |
| CAMEROON | {cm} |
| CANADA | {ca} |
| CAPE VERDE | {cv} |
| CAYMAN ISLANDS | {ky} |
| CENTRAL AFRICAN REPUBLIC | {cf} |
| CHAD | {td} |
| CHILE | {cl} |
| PEOPLE’S REPUBLIC OF CHINA | {cn} |
| CHRISTMAS ISLANDS | {cx} |
| COCOS ISLANDS | {cc} |
| COLOMBIA | {co} |
| COMORAS | {km} |
| CONGO | {cg} |
| CONGO (DEMOCRATIC REPUBLIC) | {cd} |
| COOK ISLANDS | {ck} |
| COSTA RICA | {cr} |
| COTE D IVOIRE | {ci} |
| CROATIA | {hr} |
| CUBA | {cu} |
| CYPRUS | {cy} |
| CZECH REPUBLIC | {cz} |
| DENMARK | {dk} |
| DJIBOUTI | {dj} |
| DOMINICA | {dm} |
| DOMINICAN REPUBLIC | {do} |
| EAST TIMOR | {tp} |
| ECUADOR | {ec} |
| EGYPT | {eg} |
| EL SALVADOR | {sv} |
| EQUATORIAL GUINEA | {gq} |
| ESTONIA | {ee} |
| ETHIOPIA | {et} |
| FALKLAND ISLANDS | {fk} |
| FAROE ISLANDS | {fo} |
| FIJI | {fj} |
| FINLAND | {fi} |
| FRANCE | {fr} |
| FRANCE METROPOLITAN | {fx} |
| FRENCH GUIANA | {gf} |
| FRENCH POLYNESIA | {pf} |
| FRENCH SOUTHERN TERRITORIES | {tf} |
| GABON | {ga} |
| GAMBIA | {gm} |
| GEORGIA | {ge} |
| GERMANY | {de} |
| GHANA | {gh} |
| GIBRALTER | {gi} |
| GREECE | {gr} |
| GREENLAND | {gl} |
| GRENADA | {gd} |
| GUADELOUPE | {gp} |
| GUAM | {gu} |
| GUATEMALA | {gt} |
| GUINEA | {gn} |
| GUINEA-BISSAU | {gw} |
| GUYANA | {gy} |
| HAITI | {ht} |
| HEARD & MCDONALD ISLAND | {hm} |
| HONDURAS | {hn} |
| HONG KONG | {hk} |
| HUNGARY | {hu} |
| ICELAND | {is} |
| INDIA | {in} |
| INDONESIA | {id} |
| IRAN, ISLAMIC REPUBLIC OF | {ir} |
| IRAQ | {iq} |
| IRELAND | {ie} |
| ISLE OF MAN | {im} |
| ISRAEL | {il} |
| ITALY | {it} |
| JAMAICA | {jm} |
| JAPAN | {jp} |
| JORDAN | {jo} |
| KAZAKHSTAN | {kz} |
| KENYA | {ke} |
| KIRIBATI | {ki} |
| KOREA, DEM. PEOPLES REP OF | {kp} |
| KOREA, REPUBLIC OF | {kr} |
| KUWAIT | {kw} |
| KYRGYZSTAN | {kg} |
| LAO PEOPLE’S DEM. REPUBLIC | {la} |
| LATVIA | {lv} |
| LEBANON | {lb} |
| LESOTHO | {ls} |
| LIBERIA | {lr} |
| LIBYAN ARAB JAMAHIRIYA | {ly} |
| LIECHTENSTEIN | {li} |
| LITHUANIA | {lt} |
| LUXEMBOURG | {lu} |
| MACAO | {mo} |
| MACEDONIA | {mk} |
| MADAGASCAR | {mg} |
| MALAWI | {mw} |
| MALAYSIA | {my} |
| MALDIVES | {mv} |
| MALI | {ml} |
| MALTA | {mt} |
| MARSHALL ISLANDS | {mh} |
| MARTINIQUE | {mq} |
| MAURITANIA | {mr} |
| MAURITIUS | {mu} |
| MAYOTTE | {yt} |
| MEXICO | {mx} |
| MICRONESIA | {fm} |
| MOLDAVA REPUBLIC OF | {md} |
| MONACO | {mc} |
| MONGOLIA | {mn} |
| MONTENEGRO | {me} |
| MONTSERRAT | {ms} |
| MOROCCO | {ma} |
| MOZAMBIQUE | {mz} |
| MYANMAR | {mm} |
| NAMIBIA | {na} |
| NAURU | {nr} |
| NEPAL | {np} |
| NETHERLANDS ANTILLES | {an} |
| NETHERLANDS, THE | {nl} |
| NEW CALEDONIA | {nc} |
| NEW ZEALAND | {nz} |
| NICARAGUA | {ni} |
| NIGER | {ne} |
| NIGERIA | {ng} |
| NIUE | {nu} |
| NORFOLK ISLAND | {nf} |
| NORTHERN MARIANA ISLANDS | {mp} |
| NORWAY | {no} |
| OMAN | {om} |
| PAKISTAN | {pk} |
| PALAU | {pw} |
| PALESTINE | {ps} |
| PANAMA | {pa} |
| PAPUA NEW GUINEA | {pg} |
| PARAGUAY | {py} |
| PERU | {pe} |
| PHILIPPINES (REPUBLIC OF THE) | {ph} |
| PITCAIRN | {pn} |
| POLAND | {pl} |
| PORTUGAL | {pt} |
| PUERTO RICO | {pr} |
| QATAR | {qa} |
| REUNION | {re} |
| ROMANIA | {ro} |
| RUSSIAN FEDERATION | {ru} |
| RWANDA | {rw} |
| SAMOA | {ws} |
| SAN MARINO | {sm} |
| SAO TOME/PRINCIPE | {st} |
| SAUDI ARABIA | {sa} |
| SCOTLAND | {uk} |
| SENEGAL | {sn} |
| SERBIA | {rs} |
| SEYCHELLES | {sc} |
| SIERRA LEONE | {sl} |
| SINGAPORE | {sg} |
| SLOVAKIA | {sk} |
| SLOVENIA | {si} |
| SOLOMON ISLANDS | {sb} |
| SOMALIA | {so} |
| SOMOA,GILBERT,ELLICE ISLANDS | {as} |
| SOUTH AFRICA | {za} |
| SOUTH GEORGIA, SOUTH SANDWICH ISLANDS | {gs} |
| SOVIET UNION | {su} |
| SPAIN | {es} |
| SRI LANKA | {lk} |
| ST. HELENA | {sh} |
| ST. KITTS AND NEVIS | {kn} |
| ST. LUCIA | {lc} |
| ST. PIERRE AND MIQUELON | {pm} |
| ST. VINCENT & THE GRENADINES | {vc} |
| SUDAN | {sd} |
| SURINAME | {sr} |
| SVALBARD AND JAN MAYEN | {sj} |
| SWAZILAND | {sz} |
| SWEDEN | {se} |
| SWITZERLAND | {ch} |
| SYRIAN ARAB REPUBLIC | {sy} |
| TAIWAN | {tw} |
| TAJIKISTAN | {tj} |
| TANZANIA, UNITED REPUBLIC OF | {tz} |
| THAILAND | {th} |
| TOGO | {tg} |
| TOKELAU | {tk} |
| TONGA | {to} |
| TRINIDAD AND TOBAGO | {tt} |
| TUNISIA | {tn} |
| TURKEY | {tr} |
| TURKMENISTAN | {tm} |
| TURKS AND CALCOS ISLANDS | {tc} |
| TUVALU | {tv} |
| UGANDA | {ug} |
| UKRAINE | {ua} |
| UNITED ARAB EMIRATES | {ae} |
| UNITED KINGDOM (no new registrations) | {gb} |
| UNITED KINGDOM | {uk} |
| UNITED STATES | {us} |
| UNITED STATES MINOR OUTL.IS. | {um} |
| URUGUAY | {uy} |
| UZBEKISTAN | {uz} |
| VANUATU | {vu} |
| VATICAN CITY STATE | {va} |
| VENEZUELA | {ve} |
| VIET NAM | {vn} |
| VIRGIN ISLANDS (USA) | {vi} |
| WALLIS AND FUTUNA ISLANDS | {wf} |
| WESTERN SAHARA | {eh} |
| YEMEN | {ye} |
| ZAMBIA | {zm} |
| ZIMBABWE | {zw} |
+---------------------------------------+------+

I hope you found this article useful. Have a creative and productive day ahead. :)

--

--

Abhishek Kotecha

Product Manager; Love Writing; Some Creativity; Have Musicophilia; A Traveler; Breathe Oxygen; Respect Dreams; Bulls-eye Work; Follow PM Modi; Proud Indian