KB 2685: DEFINE THE DNS TO BE USED BY THE PROXY

Published December 20, 2023

How to define which DNS server the HTTP proxy should use.

Objective

Define which DNS server the HTTP proxy should use.

BACKGROUND

By default, the Squid proxy uses the DNS declared in /etc/resolv.conf

DNS can be set from the web interface, in the Setup > Network > DNS menus.

STEPS

The dns_nameservers directive is used to specify the DNS to be used by the Squid proxy.

Go to the Proxy Cache QoS page or Settings > HTTP Proxy > HTTP > Configuration, Manual configuration section, Start of file field. Here we'll use Google's free DNS as an example:

dns_nameservers 8.8.8.8 8.8.4.4

VALIDATION

You can check which DNS is used by Squid with the squidclient command:

#squidclient -h 127.0.0.1 -p 3129 mgr:idns