There are aur packages like hosts-update, tblock, hblock, hostsblock etc that modify the hosts files to deny traffic to ads and other malware.
The size of the modified hosts files can easily run from several kilobytes to several megabytes. So will this effect the performance of the system? Isn’t the system searching all these entries everything it connects to the system? How is the performance effected especially on, say, a 15 year old computer?
I used a 48MB hosts files and my old system choked up.
I used systemd-resolved. I configured nsswitch.conf to first use the hosts file; next I configured it to use resolved since systemd-resolved caches the entries. Neither worked. Websites didn’t load.
While drill endeavouros.com @1.0.0.1 gave a result the wait was indefinite with drill endeavouros.com, when using the default DNS service.
Since the size of the hosts files impacts the performance, I decided not to use a customhosts file.
Also I think it would be okay on most modern systems but mine is a dinosaur.