<div dir="ltr"><div dir="ltr">On Wed, Apr 8, 2020 at 8:15 AM Gerard E. Seibert wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Since this does not happen on all of the mirror sites, I would like a way to get a list or have rsync display the IP of the site it received an error message from and a way to block the use of that IP in theĀ future. Is that possible?<br></blockquote><div><br></div><div>You can get rsync to ouptut the IP it connected to by using this option: --debug=connect2</div><div><br></div><div>As for avoiding a bad IP, rsync doesn't choose the IP itself, so there are a couple things you could do instead of hacking on the rsync source code to add some DNS-lookup and IP-exclusion code:</div><div><br></div><div>The simplest is to put a single IP & domain-name combo into your /etc/hosts file, at which point that will be the only mirror that rsync uses for that domain name.</div><div><br></div><div>If you instead want it to cycle between multiple IPs, you could use a simple caching DNS setup via dnsmasq. This software has a very simple override method where you specify a "addn-hosts=/file/name" line in its config file and then put multiple /etc/hosts style lines into it (since dnsmasq will add all the "IP DOMAIN" lines into a multi-IP result for that DOMAIN, unlike the normal local resolver which just picks the first IP). You'd just need to be sure to configure your localhost DNS lookups to use dnsmasq, which can be as simple as adding a "nameserver 127.0.0.1" line at the start of your /etc/resolve.conf file in front of your other nameserver line(s) (since dnsmasq skips a leading localhost nameserver line for its forwarded requests while local lookups use the first line in preference to the others). An alternative config option would be to add "alias" directives into the dnsmasq config where you tell it to replace a bad IP with a known-good IP.</div><div><br></div><div>..wayne..</div></div></div>