# Apply Pi-Hole blocking to CNAMEs

**URL:** <https://discourse.pi-hole.net/t/apply-pi-hole-blocking-to-cnames/25445>\
**Category:** Implemented\
**Created:** [November 20, 2019, 10:54am UTC](https://discourse.pi-hole.net/t/apply-pi-hole-blocking-to-cnames/25445 "2019-11-20T10:54:07Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![unixfox](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/unixfox/32/2545_2.png) [@unixfox](https://discourse.pi-hole.net/u/unixfox)\
**Post date:** [November 20, 2019, 4:16pm UTC](https://discourse.pi-hole.net/t/apply-pi-hole-blocking-to-cnames/25445/7 "2019-11-20T16:16:52Z")

</div>

Here is an example (the domains are _fake_, it's for demonstration purpose only):  
The domain adcompany.com is in my blacklist, so it returns the IP of my Pi-Hole if I do a DNS query:

```auto
$ host adcompany.com
adcompany.com has address 192.168.1.10

```

But if I do a DNS query of `ad.newspaper.com` it doesn't get blocked by Pi-Hole even though it's simply an alias (CNAME) for `adcompany.com`:

```auto
$ host ad.newspaper.com
ad.newspaper.com is an alias for adcompany.com.
adcompany.com has address 6.6.6.6

```

What I would like that Pi-hole do is to check if the domain is a CNAME (in the example `ad.newspaper.com`) then comparing the domain that is aliased to (in the example `adcompany.com`) with my blacklist. If it is in my blacklist block the domain (by returning the IP of my Pi-hole).

---

_[View the full topic](https://discourse.pi-hole.net/t/apply-pi-hole-blocking-to-cnames/25445)._
