Workaround for rclone and pihone dns problems

I can confirm this is an issue, but I suggest a different approach to solving it.

While disabling rate-limiting on pi-hole does work, it's not addressing the root cause of the problem (it's client-side) and it makes your pi-hole vulnerable to DOS attacks (if that concerns you). Also, and most critically, not everyone uses pi-holes for DNS :slight_smile:

Based on packet captures I've looked at, rclone makes a TON of DNS requests for graph microsoft com during operations against OneDrive. The system where you're running rclone should have a local DNS resolver cache, and that cache should bear the brunt of the tens of thousands of requests rclone makes. What we're seeing with this problem is evidence of a failing or misconfigured local resolver. The DNS requests I observed in my packet capture had lots of TTL remaining, yet I was seeing the same request over and over and that is bad news! It means you're going to assault your DNS server with requests, and your DNS server might block you (like our pi-holes do).

To fix this the problem, I recommend enabling your system's local resolver cache. In my case I'm running FreeBSD 12 (TrueNAS 12), and run rclone in an iocage jail. It seems that FreeBSD's local resolver cache (called "Unbound") was not enabled. I enabled it as follows:

sysrc local_unbound_enable=YES
service local_unbound start

Then, I re-ran rclone and problem solved. You should be able to do the same in any OS, and caching is usually enabled by default. I'd bet I'm not the only TrueNAS iocage jail user reading this.

2 Likes