Large hosts file will causes massive performance loss, AdGuard DNS is the solution!
HOSTS file was never designed to be an ad-blocking solution. CPU usage will rising very high because the dns service tries to resolve all domains one by one which is ineffective.
The only we can do is use ad blocking DNS server which is more efficient when it comes to blacklisting domains.
AdGuard DNS is an alternative approach to ad blocking based on intercepting and filtering DNS requests. It can be used for free on virtually any device or router.
AdGuard DNS Magisk Module
Thank to our friend at GitHub, AdGuard DNS now can be enabled systemlessly in Android Devices with this Magisk Module available to download below.
Download AdGuard-DNSCrypt Module