Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a basic squid configuration that connects to the Internet directly, I need a way to use a parent peer depending on the URL.

So for example:

  • I configure it to use a local proxy that links it to local machines for any URL with .local TLD
  • If a user requests it goes directly to port 80
  • If a user requests http://server1.local/ it goes to a machine on the LAN called server1 using the local proxy.

This is a simplified example that could be solved by DNS, but I'm doing something a little more complicated.

I tried googling for results on this but most of the results are irrelevant. Thanks.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

From the squid FAQ.

The cache_peer_domain directive allows you to specify that certain caches siblings or parents for certain domains:

#  squid.conf - On the host:
#  Format is: hostname  type  http_port  udp_port
cache_peer parent 3128 3130
cache_peer          parent 3128 3130
cache_peer   parent 3128 3130
cache_peer   parent 3128 3130
cache_peer   parent 3128 3130
cache_peer   sibling 3128 3130
cache_peer   sibling 3128 3130
cache_peer_domain .au
cache_peer_domain   .au .aq .fj .nz
cache_peer_domain     .uk .de .fr .no .se .it
cache_peer_domain     .uk .de .fr .no .se .it
cache_peer_domain     .mx .za .mu .zm

The configuration above indicates that the cache will use and for domains uk, de, fr, no, se and it, for domains mx, za, mu and zm, and for domains au, aq, fj, and nz.

Comments about cache_peer_domain from the example squid configuration file.

#  TAG: cache_peer_domain
#       Use to limit the domains for which a neighbor cache will be
#       queried.  Usage:
#       cache_peer_domain cache-host domain [domain ...]
#       cache_peer_domain cache-host !domain
#       For example, specifying
#               cache_peer_domain        .edu
#       has the effect such that UDP query packets are sent to
#       'bigserver' only when the requested object exists on a
#       server in the .edu domain.  Prefixing the domain name
#       with '!' means the cache will be queried for objects
#       NOT in that domain.
#       NOTE:   * Any number of domains may be given for a cache-host,
#                 either on the same or separate lines.
#               * When multiple domains are given for a particular
#                 cache-host, the first matched domain is applied.
#               * Cache hosts with no domain restrictions are queried
#                 for all requests.
#               * There are no defaults.
#               * There is also a 'cache_peer_access' tag in the ACL
#                 section.
# none
share|improve this answer
Thanks, I was playing with cache_peer amd acls and that didn't work. –  Osama ALASSIRY Nov 5 '10 at 23:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.