Forum Moderators: phranque
I'm assuming that we'll use an htaccess script, but any ideas would be appreciated
Kenny
I gues what Im trying to do is block specific domains such as most of the following:
21375: 0.21%: .nl (Netherlands)
20509: 0.20%: .sg (Singapore)
12594: 0.13%: .mx (Mexico)
12518: 0.12%: .jp (Japan)
11686: 0.12%: .be (Belgium)
10397: 0.11%: .br (Brazil)
10828: 0.11%: .nz (New Zealand)
10254: 0.10%: .fr (France)
6950: 0.07%: .no (Norway)
7175: 0.07%: .id (Indonesia)
7983: 0.07%: .ph (Philippines)
7110: 0.07%: .se (Sweden)
6038: 0.07%: .fi (Finland)
5667: 0.05%: .it (Italy)
4435: 0.05%: .gr (Greece)
4940: 0.05%: .de (Germany)
4705: 0.05%: [domain not given]
4181: 0.04%: .dk (Denmark)
4214: 0.04%: .hu (Hungary)
4021: 0.04%: .my (Malaysia)
4936: 0.04%: .ch (Switzerland)
3980: 0.04%: .ar (Argentina)
3504: 0.04%: .pt (Portugal)
3447: 0.04%: .arpa (Arpanet)
3004: 0.03%: .tt (Trinidad and Tobago)
2364: 0.03%: .at (Austria)
2575: 0.03%: .tr (Turkey)
2402: 0.02%: [unknown domain]
2161: 0.02%: .za (South Africa)
2081: 0.02%: .ru (Russia)
2388: 0.02%: .il (Israel)
2116: 0.02%: .do (Dominican Republic)
1539: 0.02%: .cz (Czech Republic)
1799: 0.02%: .ro (Romania)
1664: 0.02%: .hr (Croatia)
1647: 0.02%: .lt (Lithuania)
1269: 0.01%: .pk (Pakistan)
1318: 0.01%: .pl (Poland)
1201: 0.01%: .co (Colombia)
1279: 0.01%: .cl (Chile)
971: 0.01%: .uy (Uruguay)
913: 0.01%: .pe (Peru)
965: 0.01%: .tv (Tuvalu)
1144: 0.01%: .mu (Mauritius)
1000: 0.01%: .es (Spain)
910: 0.01%: .cr (Costa Rica)
765: 0.01%: .in (India)
796: 0.01%: .is (Iceland)
715: 0.01%: .mt (Malta)
530: 0.01%: .ee (Estonia)
578: 0.01%: .mz (Mozambique)
461: 0.01%: .sa (Saudi Arabia)
364: : .bg (Bulgaria)
452: : .aw (Aruba)
354: : .qa (Qatar)
353: : .cy (Cyprus)
290: : .na (Namibia)
222: : .yu (Yugoslavia)
213: : .tc (Turks and Caicos Islands)
246: : .gt (Guatemala)
184: : .info (Informational)
235: : .cc (Cocos (Keeling) Islands)
189: : .tw (Taiwan)
254: : .nu (Niue)
179: : .ws (Samoa)
216: : .sc (Seychelles)
206: : .gy (Guyana)
160: : .jm (Jamaica)
163: : .th (Thailand)
39: : .ie (Ireland)
124: : .lu (Luxembourg)
151: : .ag (Antigua and Barbuda)
164: : .ve (Venezuela)
142: : .hk (Hong Kong)
97: : .lb (Lebanon)
146: : .lv (Latvia)
71: : .py (Paraguay)
61: : .ne (Niger)
71: : .ec (Ecuador)
117: : .bm (Bermuda)
27: : .li (Liechtenstein)
5: : .bz (Belize)
74: : .biz (Businesses)
66: : .bn (Brunei Darussalam)
49: : .mk (Macedonia (Former Yugoslav Republic))
46: : .sm (San Marino)
27: : .af (Afghanistan)
35: : .bs (Bahamas)
66: : .kr (South Korea)
46: : .ky (Cayman Islands)
17: : .ni (Nicaragua)
26: : .lk (Sri Lanka)
26: : .gi (Gibraltar)
16: : .sk (Slovakia)
16: : .ad (Andorra)
37: : .ae (United Arab Emirates)
9: : .ac (Ascension Island)
2: : .to (Tonga)
1: : .si (Slovenia)
4: : .ke (Kenya)
The products sold on the site are not available in these countries and most of the 'hacking' attempts (and successes) have been traced to out of country domains.
Is there a command or series of commands to block domain extensions as opposed to IP addresses?
Any help would be great.. The above stats are for 2 weeks of use on one domain.. So you can inagine how much bandwidth is going out the window.
Kenny
Deny users by IP
In your htaccess file, add the following code--changing the IPs to suit your needs--each command on one line each:
order allow,deny
deny from 123.45.6.7
deny from 012.34.5.
allow from all
You can deny access based upon IP address or an IP block. The above blocks access to the site from 123.45.6.7, and from any sub domain under the IP block 012.34.5. (012.34.5.1, 012.34.5.2, 012.34.5.3, etc.) I have yet to find a useful application of this, maybe if there is a site scraping your content you can block them, who knows.
You can also set an option for deny from all, which would of course deny everyone. You can also allow or deny by domain name rather than IP address (allow from .javascriptkit.com works for www.javascriptkit.com or virtual.javascriptkit.com, etc.)
then add
ErrorDocument 403 /123.html
in the .htaccess file, 403 means Forbidden, 123.html is the page you want redirect to.
My concern is tryin to pin down the specific ips for all those countries... And if I use the domain extension (.nl, .jp, etc), I will run the risk of requiring a domain resolution for every visitor which will slow the server down to a crawl... I guess I could start a databases of ips that I want to block...
Just wondering if there was a simpler solution... or an outside company that makes software to do this.