Time for action – constructing ACL lists using domain names
Let's construct an ACL to identify requests for pages on www.example.com
.
acl example dstdomain www.example.com
The previous ACL element will be able to identify any request for any web page on the domain www.example.com
. So, if we try to browse http://www.example.com/
or http://www.example.com/index.html
, the URLs will be identified by the ACL example.
However, the problem with this ACL is that it will not be able to identify requests to example.com
or some.example.com
and so on. So, if we browse to http://example.com/
or http://video.example.com/
, our requests will not be identified by the ACL example
.
To overcome this problem, we can prefix the domain name with a period or dot (.). A dot is treated as a wildcard by Squid and an ACL will match that domain or any sub-domain of that particular domain. Let's see an example.
acl example dstdomain .example.com
The previous ACL element will match example.com
or any of its sub-domains such...