Hi.

With the recent release of Linux 2.4.28, which fixes some security
issues I quickly set out to grab a copy so that I could update my
distribution.  However, I was having a problem because the file isn't
on all the mirrors yet.  So I put wget in a simple while loop to get
around the "if file is not found, quit retrying" behaviour.  It should
be a safe thing to do since ftp.us.kernel.org uses a round robin dns
scheme, which means that everytime you lookup the host, it returns the
list of IP's in a different order.  However, it seems like wget sorts
the IP's it gets from the resolver in the order of lowest to highest.

I looked through the manpage but didnt see a way to change this
behaviour.

very simple while..

while [ ! -f linux-2.4.28.tar.bz2 ]; do wget -c
ftp://ftp.us.kernel.org/pub/linux/kernel/v2.4/linux-2.4.28.tar.bz2;
done

Resolving ftp.us.kernel.org... 128.46.156.117, 128.105.103.12,
128.118.2.96, ...Connecting to ftp.us.kernel.org[128.46.156.117]:21...
connected.

Resolving ftp.us.kernel.org... 66.230.217.253, 69.31.98.210,
128.30.2.36, ...
Connecting to ftp.us.kernel.org[66.230.217.253]:21... connected.

While this seems to work fine after a while on linux, maybe because my
setup isn't caching dns, or my dns server is working differently, I
have a problem running this from work. 

Resolving ftp.us.kernel.org... 144.92.104.38, 144.174.32.40,
155.98.64.81, ...
Connecting to ftp.us.kernel.org[144.92.104.38]:21... connected.

Which will just happen over and over.  It won't connect to any IP
other than 144.92.104.38.  But when I use dig, the order
is definately different.  Something else to note is at work I'm
trying this on OSX 10.3.6, with wget 1.9.1, which was provided by
'fink'.  On my linux box I'm also running wget 1.9.1.  Either way, why
is wget sorting the list of IP's it gets from the resolver?  I feel if
wget wasn't sorting the IP's, this problem wouldn't happen.  But maybe
there is a reason for it?

Thanks
-miah

Reply via email to