2

I'm having DNS issues with a squid setup. I also tried using dns_nameservers directive in my squid.conf to point to the DNS servers. I have a scenario where www.example.com is supposed to go out to the internet, but foo.example.com is supposed to go to an internal domain. From my client, when I attempt to ping foo.example.com, it picks up the right IP, but I get this error on my browser:

Unable to determine IP address from hostname foo.example.com  
The DNS server returned:  
Name Error: The domain name does not exist

I know that my client is pointing to right IP (because ping works fine), but I'm curious why squid would attempt to connect to the public example.com.

0

2 Answers 2

1

Documentation I read suggest that by default, Squid picks up the name servers from the file /etc/resolv.conf. However, that didn't work for me. Although the OS (Debian) itself could resolve the IP, squid was complaining. I made the following changes and got it working:
/etc/nsswitch.conf:
hosts: files dns
/etc/hosts:
<ip_of_server> foo.example.com

I'm still trying to figure out why squid doesn't pick up name servers from /etc/resolv.conf.

1
  • it's wrong, squid will pick up hosts from nss first, if there is no hosts file specified by default.
    – GioMac
    Sep 9, 2013 at 21:46
0

Which DNS server is the client using? The fact that the client can resolve it correctly bears little effect on squid.

When using a proxy, the server does the DNS resolution, so the DNS resolution of the client doesn't matter; it just needs to be able to resolve the proxy's address.

Are you able to ping foo.example.com from the squid server? If not, the client and server must be using different DNS servers, or they are being served different views for that zone.

1
  • The client is using a DNS server which resides on the internal network (not public). The squid server can resolve foo.example.com (because I have my name server in /etc/resolv.conf). And the client can resolve foo.example.com too. I can provide a more detailed description if need be. The client and server are pointing to the same DNS server.
    – Sheela N
    Sep 11, 2013 at 15:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .