codeblog code is freedom — patching my itch

April 30, 2006

slow debian mirror avoidance

Filed under: Networking — kees @ 8:02 pm has 4 mirror servers in their DNS round-robin. One of them ( is very slow (25Kb/s) for me. The others are blazing fast, especially (800Kb/s). I’ve gotten sick of having to hit Ctrl-C to abort an apt-get, and then restart it, hoping to get a better server out of the DNS.

Today, I added the following to my machine’s iptables config, so that it will just redirect all attempts from the slow mirror to the fast mirror:

iptables -t nat -A OUTPUT -p tcp -d –destination-port 80 -j DNAT –to-destination

If I wanted to do this for my whole network, I’d just slap this rule on my firewall and change “OUTPUT” to “PREROUTING”.

I love iptables.

© 2006, Kees Cook. This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 License.
CC BY-SA 4.0

No Comments

No comments yet.

Powered by WordPress