Any way to cache large /etc/hosts files?

Solène Rapenne solene at perso.pw
Sun Aug 7 17:59:41 UTC 2016


Le 2016-08-05 20:33, Yuri a écrit :
> Some people suggest using pre-compiled lists of ad and malware domains
> and block them on DNS level. (ex.
> https://github.com/StevenBlack/hosts)
> 
> The resulting hosts file is about 1MB. nscd(8) caches DNS results, but
> it does this on name by name basis. Every new domain name request,
> even within the same process, causes /etc/hosts file to be reread
> again.
> 
> 
> Is there a way to cache /etc/hosts once and use it?
> 
> 
> Yuri
> 
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to 
> "freebsd-questions-unsubscribe at freebsd.org"


Hello,

Maybe adsuck would be a good tool for what you want.

It original purpose it to use lists of blacklisted hosts to redirect 
them to 127.0.0.1 by using the dns system and stop ads in browing. 
adsuck uses files with the same syntax as /etc/hosts and then if it 
doesn't know the name if will pass the request to your DNS resolver.


More information about the freebsd-questions mailing list