# Can you block a domain from accessing your website?

**URL:** https://boards.straightdope.com/t/can-you-block-a-domain-from-accessing-your-website/314321
**Category:** Factual Questions
**Created:** [July 26, 2005, 11:39pm UTC](https://boards.straightdope.com/t/can-you-block-a-domain-from-accessing-your-website/314321 "2005-07-26T23:39:56Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Thin\_Lizzy](https://avatars.discourse-cdn.com/v4/letter/t/e9a140/32.png) [@Thin\_Lizzy](https://boards.straightdope.com/u/Thin_Lizzy)
#### Post date: [July 26, 2005, 11:39pm UTC](https://boards.straightdope.com/t/can-you-block-a-domain-from-accessing-your-website/314321/1 "2005-07-26T23:39:56Z")

</div>

Suppose you have a website and you want to block access from a certain domain, for example say you wanted to block access to anyone in the [aol.com](http://aol.com) domain. is this possible?

---

<div class="post-metadata">

### Author: ![rfgdxm](https://avatars.discourse-cdn.com/v4/letter/r/c0e974/32.png) [@rfgdxm](https://boards.straightdope.com/u/rfgdxm)
#### Post date: [July 26, 2005, 11:53pm UTC](https://boards.straightdope.com/t/can-you-block-a-domain-from-accessing-your-website/314321/2 "2005-07-26T23:53:22Z")

</div>

Yes, but you’d need to ban every possible [aol.com](http://aol.com) IP address.

---

<div class="post-metadata">

### Author: ![Mops](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mops/32/16494_2.png) [@Mops](https://boards.straightdope.com/u/Mops)
#### Post date: [July 27, 2005, 5:04pm UTC](https://boards.straightdope.com/t/can-you-block-a-domain-from-accessing-your-website/314321/3 "2005-07-27T17:04:17Z")

</div>

Most web server software does allow this; e.g. for Apache the code in the .htaccess file for your site would be

```auto

Order deny,allow
Deny from .aol.com

```

The downside to specifying the excluded IP addresses by domain name is that your web server must perform a reverse name server lookup every time someone accesses the site (i.e. ask the DNS system what the domain name address corresponding to the IP address is), which might significantly degrade the web server’s performance.
