6.4. Squid でのドメイン拒否リストの設定
多くの場合、管理者は特定のドメインへのアクセスをブロックする必要があります。このセクションでは、Squid でドメインの拒否リストを設定する方法を説明します。
前提条件
- Squid が設定され、ユーザーはプロキシーを使用できます。
手順
/etc/squid/squid.confファイルを編集し、以下の設定を追加します。acl domain_deny_list dstdomain "/etc/squid/domain_deny_list.txt" http_access deny all domain_deny_list
acl domain_deny_list dstdomain "/etc/squid/domain_deny_list.txt" http_access deny all domain_deny_listCopy to Clipboard Copied! Toggle word wrap Toggle overflow 重要ユーザーまたはクライアントへのアクセスを許可する最初の
http_access allowステートメントの前にこれらのエントリーを追加します。/etc/squid/domain_deny_list.txtファイルを作成し、ブロックするドメインを追加します。たとえば、サブドメインを含むexample.comへのアクセスをブロックして、example.netをブロックするには、以下を追加します。.example.com example.net
.example.com example.netCopy to Clipboard Copied! Toggle word wrap Toggle overflow 重要squid 設定の
/etc/squid/domain_deny_list.txtファイルを参照している場合は、このファイルは空にすることはできません。このファイルが空の場合、Squid は起動できません。squidサービスを再開します。systemctl restart squid
# systemctl restart squidCopy to Clipboard Copied! Toggle word wrap Toggle overflow