Name

hosts_file

Synopsis

When you use the internal DNS implementation (the default), Squid always uses the DNS name servers to resolve names and addresses. The external dnsserver program, on the other hand, may check a local database—the hosts file—before querying the DNS. With this directive, you can make Squid preload the contents of a hosts file into its IP and FQDN caches.

Squid rereads the hosts file when you send it the reconfigure signal (squid -k reconfigure).

If you configure the append_domain directive, it’s appended to any single-component names in the hosts file.

Syntax

hosts_file pathname

Default

No default

Example

hosts_file /usr/local/squid/etc/hosts

Related

dns_defnames, append_domain

Get Squid: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.