Sunday 14 December 2014

Squid on cygwin "Unable to determine IP address from host name"

I recently started using vagrant+docker which meant that I started downloading a lot of RPMs, docker images and vagrant boxes.

To reduce the amount of time I spend waiting for packages to be downloaded, I set up squid on cygwin. The set up wasn't too complicated, but I got stuck with something. Squid reads /etc/resov.conf to find out which nameserver to use... and cygwin doesn't create (nor need) this file. This mean that I spend 1 hour trying to figure out why squid wasn't able to resolve names. This is part of the html Squid generated to report the error.
The following error was encountered while trying to retrieve the URL: http://google.com/

     Unable to determine IP address from host name "google.com"
So if you want to run squid on cygwin, don't forget to create a /etc/resolv.conf file similar to the following one

search local
nameserver 8.8.8.8
I chose to use google's DNS (8.8.8.8) for the time being, but the best solution would be to run a script when I launch cygwin that creates/updates the resolv.conf file with my current DNS... but I have no idea at the moment how to get this data from windows.

No comments:

Post a Comment