Forum Moderators: phranque

Message Too Old, No Replies

I'd appreciate a confirmation for an htaccess ban rule

banning a country by hostname with the risk of going too far

         

oliverfr

10:27 am on Jun 17, 2009 (gmt 0)

10+ Year Member



Hello,

Japanese users have become a problem on one of my websites, and I would need to ban japan on server level, with my .htaccess file.

However, the list of japanese IPs is almost 1780 lines long, that's a 47 kb text file !
I'm afraid a sole htaccess so big might become a problem, so I am trying to ban the japan on a hostname basis instead.

However - that's the reason I'm asking you guys for a confirmation -, in your opinion, ".jp", is it safe to ban such a short text string, or do you think there is a risk to accidentally have perfectly legitimate hostnames banned with it ?

The code I'm thinking of would be, very simply :

order allow,deny
deny from .jp
allow from all

Or else, if you know where a list of japanese hostnames exists (I spend a full hour searching without success), in order to ban hostnames like .co.jp or .ac.jp instead, you're more than welcome :)

Thanks for reading me, and thank you very much if you can help, I'll be grateful !

Oliver

webdoctor

12:49 pm on Jun 17, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



if you know where a list of japanese hostnames exists

If you already have a list of japanese IPs, you could always do reverse look-ups to get the hostnames

Although I have no direct experience of Japan, judging by the way other countries and ISPs choose hostnames I would be *very* surprised if all the hostnames ended in .jp

jdMorgan

12:57 pm on Jun 17, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Another approach is to make note of the IP address ranges (for example, those of ISPs) that are actually causing you a problem, and blocking only those. I suspect your list of 1780 IP ranges includes many ranges that are not actually a problem.

Hit the high spots, in other words.

You could also look at the referrers to see if one or only a few referrers are giving you problems.

Jim

wilderness

1:53 pm on Jun 17, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The second line of this brief example [webmasterworld.com] will provide denial to the majority of APNIC visitors.