FreeBSDでnscdを使う

/etc/nscd.conf

enable-cache passwd yes
enable-cache group yes
enable-cache hosts yes
enable-cache services yes
enable-cache protocols yes
enable-cache rpc yes
enable-cache networks yes

positive-time-to-live   passwd          600
negative-time-to-live   passwd          5
keep-hot-count          passwd          20

positive-time-to-live   group           3600
negative-time-to-live   group           5
keep-hot-count          group           20

positive-time-to-live   hosts           600
negative-time-to-live   hosts           5
keep-hot-count          hosts           20

positive-time-to-live   services        3600
negative-time-to-live   services        5
keep-hot-count          services        20

positive-time-to-live   protocols       3600
negative-time-to-live   protocols       5
keep-hot-count          protocols       20

positive-time-to-live   rpc             3600
negative-time-to-live   rpc             5
keep-hot-count          rpc             20

positive-time-to-live   networks        3600
negative-time-to-live   networks        5
keep-hot-count          networks        20

/etc/rc.conf

nscd_enable="YES"