Name

cache_peer_domain

Synopsis

This directive allows you to restrict forwarded requests by their domain names. For example, you can make sure that URIs in a certain domain never go to your parent cache. Similarly, you can make sure that requests for only a few specific domain names are sent to a neighbor. The cache_peer_domain directive has been largely superseded by cache_peer_access, which is much more flexible.

Following the neighbor’s hostname, you can specify a list of domain names. These are searched in order, until Squid finds a match. A match means that the request can be sent to the neighbor, unless you prefix the domain name with ! (“not”). For example, .foo.com means “allow .foo.com,” while !.bar.net means “disallow .bar.net.” If none of the listed domains match the URL, the default action (allow or deny) is the opposite of the last one in the list.

Note, the domain name matching algorithm is somewhat tricky. See the description in Section 6.1.1.2.

Syntax

cache_peer_domain hostname 
                              domain ...

Default

No default

Example

cache_peer_domain bigcache.isp.net .net .org
cache_peer_domain aol.web-cache.net !.ads.aol.com .aol.com

Related

cache_peer, cache_peer_access, neighbor_type_domain

Get Squid: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.