Comment 4 for bug 84104

Revision history for this message
Micah Cowan (micahcowan) wrote :

There is no software anywhere that would ever do a DNS lookup before each packet in a TCP connection. For one thing, that would be just ridiculously expensive, at least doubling the number of packets being sent out, and imposing huge delays as the application waits for the DNS response. For another, once a TCP connection is established, all packets must necessarily be between the same IP addresses. A "connection" is defined by an address/port pair on each end. If you change any of those, it's not the same connection anymore. Thirdly, once a connection has been established, the system kernel typically handles all the low-level packet sending, not the application. So, it really wouldn't make sense to have an option that controls DNS querying between packets for a single connection.

As Diego indicated, wget caches DNS values by default, to enhance efficiency. If this is not the behavior you desire, you should use the --no-dns-cache option.

...However, I think your point that wget ought "to do everything it can" to succeed in reestablishing connection is a valid one. In the situation you've described, it's not possible for wget to avoid losing the initial connection, but if it fails in its second attempt, it should possibly attempt a DNS lookup. I'll go ahead and confirm this bug (I'm actually the upstream maintainer… as of yesterday!). I'll set the priority low, though, as there is a simple workaround (--no-dns-cache), and I have other things that will keep me busy for a while. :)