DNS server configuration
For every request received from a client, Squid needs to resolve the domain name before it can contact the target web server. For this purpose, Squid can either use the built-in internal DNS client or, external DNS program to resolve the hostnames.
The default behavior is to use the internal DNS client for resolving hostnames unless we have used the --disable-internal-dns
option but it must be set with the configure
program before compiling Squid, as shown:
$ ./configure --disable-internal-dns
Let's have a quick look at the DNS-related configuration directives provided by Squid.
Specifying the DNS program path
The directive
cache_dns_program
is used to specify the path of the external DNS program built with Squid. If we have not moved the Squid-related file after installing, this directive will have the correct value, by default. However, if the DNS program is located at a different location, we can specify the path using the following directive:
cache_dns_program...