Will large hosts file impact performance?

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?

Yes. The question is, will it be a meaningful or noticeable performance change.

The best way to find out is to try it on your machine and see. It is easy to add and remove so just try it and see if there is any impact.


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 @ 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 custom hosts file.

Also I think it would be okay on most modern systems but mine is a dinosaur.

> inxi
CPU: dual core Intel Core2 Duo E7400 (-MCP-) speed: 2792 MHz
Kernel: 5.17.7-arch1-1 x86_64 Up: 5h 58m Mem: 2650.6/3484.8 MiB (76.1%)
Storage: 2.22 TiB (66.3% used) Procs: 192 Shell: fish inxi: 3.3.15

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.