Questo contenuto non è disponibile nella lingua selezionata.

16.4. Configuring a Domain Blacklist in Squid


Frequently, administrators want to block access to specific domains. This section describes how to configure a domain blacklist in Squid.

Prerequisites

  • Squid is configured, and users can use the proxy.

Procedure

  1. Edit the /etc/squid/squid.conf file and add the following settings:
    acl domain_blacklist dstdomain "/etc/squid/domain_blacklist.txt"
    http_access deny all domain_blacklist

    Important

    Add these entries before the first http_access allow statement that allows access to users or clients.
  2. Create the /etc/squid/domain_blacklist.txt file and add the domains you want to block. For example, to block access to example.com including subdomains and to block example.net, add:
    .example.com
    example.net

    Important

    If you referred to the /etc/squid/domain_blacklist.txt file in the squid configuration, this file must not be empty. If the file is empty, Squid fails to start.
  3. Restart the squid service:
    # systemctl restart squid
Red Hat logoGithubRedditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita ilBlog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

© 2024 Red Hat, Inc.