Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add the FreeBSD usage instructions #157

Closed
yurivict opened this issue Aug 5, 2016 · 12 comments
Closed

Please add the FreeBSD usage instructions #157

yurivict opened this issue Aug 5, 2016 · 12 comments

Comments

@yurivict
Copy link

yurivict commented Aug 5, 2016

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

  • Enable nscd daemon with the command:
# sysrc nscd_enable="YES""
  • Start nscd daemon with the command:
# service nscd start
  • Enable nscd DNS cache by changing the "hosts" line in /etc/nsswitch.conf to: 'hosts: cache files dns'
@yurivict yurivict changed the title Please add the FreeBSD use instructions Please add the FreeBSD usage instructions Aug 5, 2016
@StevenBlack
Copy link
Owner

Thanks @yurivict.

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

@StevenBlack
Copy link
Owner

I still need someone to try this n FreeBSD.

@Guymer
Copy link

Guymer commented Sep 2, 2017

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
Copy link
Owner

Thank you for the input, Thomas @Guymer!

@gfyoung
Copy link
Contributor

gfyoung commented Aug 2, 2018

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
Copy link

Guymer commented Aug 2, 2018

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
Copy link
Contributor

gfyoung commented Aug 3, 2018

@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
Copy link

Guymer commented Aug 3, 2018

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

@gfyoung
Copy link
Contributor

gfyoung commented Aug 3, 2018

@Guymer : Gotcha. Just to double check:

  • The commands for enabling ncsd from @yurivict require root as well?
  • What is the full path to the nscd daemon? (e.g. /etc/inid.d/nscd) ?

@Guymer
Copy link

Guymer commented Aug 3, 2018

@gfyoung :

  • yes, the commands to enable ncsd from @yurivict require root; and
  • the full path to the nscd service script is /etc/rc.d/nscd and the full path to the nscd binary is /usr/sbin/nscd (though this really should not be relevant).

@gfyoung
Copy link
Contributor

gfyoung commented Aug 3, 2018

(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.

gfyoung added a commit to forking-repos/hosts that referenced this issue Aug 3, 2018
@StevenBlack
Copy link
Owner

Thanks everybody!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants