Forum Moderators: phranque

Message Too Old, No Replies

banning with remote host wildcard

         

Chalupee

12:13 pm on Nov 24, 2003 (gmt 0)

10+ Year Member



banning with remote host wildcard

I am not sure if I even have this correct in the syntax.. using

I am unable to get remote host to work.

RewriteEngine On
RewriteCond %{REMOTE_HOST} ^.somedomain\.net$ [OR]
RewriteCond %{REMOTE_ADDR} ^68\.50\.*
RewriteRule .* [gingsouthwoop.com...] [R=301,L]

It works for banning with Remote_Addr but thats not what I want.
I want to ban based the host, aol.com .... AND anybody from
that domain (or simialar) I don't want to use IP addresses because
as you know aol.com (and others) are always changing.

So the question(s) is,
1.) do I even have the syntax correct for remote_host
and
2.) are there wild cards for the remote_host so if a somebody comes in
as cache-rh05.proxy.aol.com they get banned the same as
cache-by12.proxy.aol.com
the aol.com people... or similarily where the remote host changes from
time to time like this will pcp000000pcs.retard01.va.comcast.net
but the comcast.net stays the same.

thanks a bunch for your help group...
Chalupee

jdMorgan

9:04 pm on Nov 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Chalupee,

The problem is that you have start-anchored your remote_host string, and it will match only a remote hostname meeting the following pattern:
"Any single character followed by the exact string 'somedomain.net'"

The "^" and "." are special characters to the regular expressions [etext.lib.virginia.edu] parser used by mod_rewrite.

I would recommend that you re-think using remote_host to block access. You will force your server to do a reverse-DNS lookup for every single page, image, and script requested from it. This is very, very slow. You might consider going to ARIN once a month and looking up all of the IP ranges assigned to the entities you don't like, and including those IP ranges in your .htaccess file ban list.

Jim

Chalupee

9:24 pm on Nov 24, 2003 (gmt 0)

10+ Year Member



thanks JD...
I understand what your saying but it's not my
whole site just a directory that I would like
to use to sort out leaches.
I have spent so much time chasing down "shifting"
IPs its ridiculous.
i still cant get remote_host to work though..

oh well thats life...

jdMorgan

9:48 pm on Nov 24, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



RewriteCond %{REMOTE_HOST} \.somedomain\.net$ [OR]

Chalupee

3:29 pm on Nov 26, 2003 (gmt 0)

10+ Year Member



Thanks JD... but the problem is actually
that my hosting company doesn't have remote_host working..
They have told me it is... (liars or idiots).

On another company's server I use I tested
what we were working on and just a simple ssi command
to return the remote_host.

Works fine on the other company servers but not
the one I want it too work on, so I'll see later today
what happens when I get the next response back from tech.

I apologize for not proplerly testing my company's server
and relying on just what they told me.

Thanks again.
Chalupee.

jdMorgan

5:12 pm on Nov 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Chalupee,

Yeah, you need to convince them to give you HostnameLookups on in the <VirtualHost> container for your site. The reason they have it turned off is because of the performance issue I mentioned above.

Best of luck,
Jim