免费注册
帮助文档(华北一、二)

  • 在Linux中开启NSCD服务可在本地缓存DNS解析结果。在TTL时间内,无需去DNS服务器重复解析,从而加快DNS的解析速度,也缓解DNS服务器的压力。

    本操作步骤以CentOS为例。

    Windows中则无需额外配置,本地DNS缓存默认启用。

    1. 安装

     yum install nscd

    2. 增加配置文件 /etc/nscd.conf

    配置如下:

     
    # /etc/nscd.conf 
    # An example Name Service Cache config file.  This file is needed by nscd. 
    # Legal entries are: 
    #       logfile                 <file> 
    #       debug-level             <level> 
    #       threads                 <initial #threads to use> 
    #       max-threads             <maximum #threads to use> 
    #       server-user             <user to run server as instead of root> 
    #               server-user is ignored if nscd is started with -S parameters 
    #       stat-user               <user who is allowed to request statistics> 
    #       reload-count            unlimited|<number> 
    #       paranoia                <yes|no> 
    #       restart-interval        <time in seconds> 
    #       enable-cache            <service> <yes|no> 
    #       positive-time-to-live   <service> <time in seconds> 
    #       negative-time-to-live   <service> <time in seconds> 
    #       suggested-size          <service> <prime number> 
    #       check-files             <service> <yes|no> 
    #       persistent              <service> <yes|no> 
    #       shared                  <service> <yes|no> 
    #       max-db-size             <service> <number bytes> 
    #       auto-propagate          <service> <yes|no> 
    # Currently supported cache names (services): passwd, group, hosts, services 
    #   logfile                 /var/log/nscd.log