F
F
fatalick2019-05-08 12:30:35
Squid
fatalick, 2019-05-08 12:30:35

How do I configure Squid to automatically apply domain name rules to matching IP addresses?

Hey!
Here is part of the squid config:

acl test dstdomain .domain.com
http_access deny test

I open the page in the browser - I enter domain.com. I receive a squid thump, as well as it is expected.
If you open the same page, but use the IP address instead of the name, then access is not blocked.
Is there a way to automatically block IPs to which domains resolve, so as not to add a separate rule for the name and a separate rule for IP for each resource (there can be several ips, it can change, etc.)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nick Neo, 2019-05-08
@nickneo

acl ip_access url_regex -i ^ http://[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+
acl exclude_ip url_regex -i ^ http:// 72\.14\.207\.104 - definition of the exclusion group (allowed choice of digital ip)
http_access deny ip_access !exclude_ip - deny access to all ip dialed "in numbers" except for exclude_ip

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question