# Apache - Hostname bans



## Addy (Oct 21, 2007)

Hello, I've been experiencing a little trouble with a user. I've tried banning his host, but with no success. Here's what I've tried.
deny from *.dhcp.embarqhsd.net
He still gets in with that host. Any idea how I can ban him, besides an IP ban? Thanks for the help.


----------



## Addy (Oct 21, 2007)

I've protected my phpBB forum, with the following bit of code. Add it to common.php if you're interested.

```
if (fnmatch('*.dhcp.embarqhsd.net',gethostbyaddr($_SERVER['REMOTE_ADDR']))) exit;
```


----------



## johnwill (Sep 26, 2002)

What's wrong with the IP ban?


----------



## Addy (Oct 21, 2007)

He gets a new IP every week or so.


----------



## johnwill (Sep 26, 2002)

Well, that's a problem. :smile: I think I'd just annoy him with the IP ban until he goes away.


----------



## Addy (Oct 21, 2007)

That's the thing though, the reason he attacks my site is because I've annoyed him. He spammed my guestbook with alternate IP's, and that prompted me to ban his host. After this, he used a proxy to enter my forum, and he told me that if I tried to ban him again, he would take down my server. I banned the proxy, and he tried to DoS my forum, but I banned him through phpBB and he eventually gave up. He'll probably attack again, with a different proxy.


----------



## johnwill (Sep 26, 2002)

I suggest you contact the local authorities. What he is doing is clearly illegal, and perhaps the thread of a jail cell may make him see the light.


----------

