StevenBlack / hosts

🔒 Consolidating and extending hosts files from several well-curated sources. Optionally pick extensions for porn, social media, and other categories.
MIT License
26.88k stars 2.23k forks source link

Please add the FreeBSD usage instructions #157

Closed yurivict closed 6 years ago

yurivict commented 8 years ago

You should include the FreeBSD usage section: It is recommended that DNS requests are cached using nscd(8).

# sysrc nscd_enable="YES""
# service nscd start
StevenBlack commented 8 years ago

Thanks @yurivict.

Can somebody on FreeBSD confirm this for me? A pull request would be great :-)

StevenBlack commented 8 years ago

I still need someone to try this n FreeBSD.

Guymer commented 7 years ago

Hi, I just tried this on my FreeBSD 11.1 box and it appears to work. I manually added the line nscd_enable="YES" to my /etc/rc.conf file rather than use the sysrc utility. That is just personal preference I think. My only comment on the whole method is that using nscd at all is optional. It will improve performance by caching the results of /etc/hosts but I think this is going to be of marginal benefit for my usage scenario.

StevenBlack commented 7 years ago

Thank you for the input, Thomas @Guymer!

gfyoung commented 6 years ago

So is there really anything that needs to be added for FreeBSD? Sounds like these instructions weren't actually needed perhaps (can't confirm personally unfortunately)?

Guymer commented 6 years ago

I think a comment in the Reloading Hosts File section about enabling nscd and using nscd.conf on FreeBSD would be beneficial. The only difference between what I did and what @yurivict did was exactly how we each enabled nscd in rc.conf. @yurivict's way is safer for new FreeBSD users.

gfyoung commented 6 years ago

@Guymer : So what command would they use to clear the DNS cache after they have enabled nscd (didn't realize it wasn't enabled by default)? Something along the lines of nscd --invalidate=????

Guymer commented 6 years ago

@gfyoung : You can either restart the machine or run service nscd restart (as root) to restart the nscd service.

gfyoung commented 6 years ago

@Guymer : Gotcha. Just to double check:

Guymer commented 6 years ago

@gfyoung :

gfyoung commented 6 years ago

(though this really should not be relevant).

@Guymer : If you look at our code, we already have a section of logic for nscd. Hence, I wanted to double check that we could just incorporate it into that section instead of writing custom logic for FreeBSD.

StevenBlack commented 6 years ago

Thanks everybody!