Squid can't complete external DNS queries

18,512

On a Windows machine, if squid is not told to use specific nameservers in squid.conf, it should use the system nameservers by interogating the registry. This can be seen in the cache.log, when searching for "Adding nameserver".

If this doesn't work for any reason (sometime it will incorrectly choose itself as a nameserver - 127.0.0.1), you can add specific name servers in squid.conf:

dns_nameservers 8.8.8.8 208.67.222.222
Share:
18,512

Related videos on Youtube

phillid
Author by

phillid

please delete me

Updated on September 18, 2022

Comments

  • phillid
    phillid almost 2 years

    I've downloaded and configured with a minimal configuration file. I'm running Squid 2.7 on a Windows box. I've configured a client machines' browser to use my proxy server, but all external DNS queries don't work (i.e. www.google.com doesn't work but a local name works fine). Here's the error page I get:

    The requested URL could not be retrieved
    
    While trying to retrieve the URL: http://www.google.com/
    
    The following error was encountered:
    
        Unable to determine IP address from host name for www.google.com 
    
    The dnsserver returned:
    
    Refused: The name server refuses to perform the specified operation. 
    
    This means that:
    
    The cache was not able to resolve the hostname presented in the URL. 
    Check if the address is correct. 
    
    Your cache administrator is ##################.
    Generated Thu, 12 Jan 2012 22:34:15 GMT by ######## (squid/2.7.STABLE8)
    

    I think I have an unusual network setup, like this:

                               router
                           ____/    \____
                          /              \
    internet ---- my proxy server      client PC
    

    Does my setup have something to do with it? Any suggestions as to how to solve the problem? Thanks

    • Paul
      Paul over 12 years
      If you ping google from.com the squid box does it resolve?
    • phillid
      phillid over 12 years
      Yes. Also, from the client machine, I can request google's IP address through the proxy and it works fine.
    • Paul
      Paul over 12 years
      Ok, can you check if you have any dns_nameserver entries in the squid.conf file?
    • phillid
      phillid over 12 years
      Yes, I just did it, thanks :D I knew I'd missed something simple like that... Oh well, I ges this question may be found by someone else in the future and save them asking the question too
    • Paul
      Paul over 12 years
      Actually, on a Windows box, having no dns_nameserver entries should make squid use the system DNS, which we confirmed as working. Your fix is a workaround really, but if it works... I'll add this as an answer though so you can accept it and get it off the unanswered list.