If you have a Raspberry Pi, look into using Pi-hole[1]. It provides network-wide blocking when installed on your home network by proxying requests. I also use AdGuard Pro[2], which provides a similar function when I'm outside my home network. Both happen to be open source software[3][4], so that's a plus.
> Not for iOS though, atleast without a jailbreak.
If you have persistence, no jailbreak is needed. Would require you to binary patch the executable then resign the binary using your own Apple Dev account. Far from trivial, but still doable and without Jailbreaking.
Even if you install a root cert to MITM, some apps pin certs.