Friday, January 08, 2010

Cygwin & Bind tools: Don't forget /etc/resolv.conf!

I recently started a new job and was installing all my Windows tools (yup, back in Windows!). Installed Cygwin and added a few tools, specifically I had gotten used to using host & dig during my stint doing linux administration, so I added in the Bind distribution for Cygwin. When I tried to use host or dig I got an error: ;; communications error: connection reset

After some researching I found that although bind works in cygwin the /etc/resolv.conf is not created. You have to do that manually. I created the file (see example below) and the commands now work fine. Figuring out your nameservers is up to you for now.

This was on Windows Server 2003 SP2 using CYGWIN_NT-5.2 forsrayd 1.7.1(0.218/5/3).

My resolv.conf (valid ips removed):
nameserver x.x.x.x
nameserver x.x.x.x

1 comment:

Al Toid said...

Just a weird cygwin in system 7 thing, too.

I find that sometimes I get forking errors, when I'm trying to pipe commands together.

find . -name "*.[hc]*" -exec grep some-string {} \; -print |& tr -d "\r" |& tee output-file

Or something like that.

And then there's the protection issues if you're not running as admin.