配置转发器 - BIND 版本 9.4

要为 BIND 版本9.4配置转发服务器,请使用此步骤,编辑一系列文件,然后使用 SMIT 或命令行启动 named 守护进程。

  1. 编辑 /etc/named.conf 文件。
    如果 /etc 目录中没有 named.conf 文件,请将 /usr/samples/tcpip/named.conf 样本文件复制到 /etc 目录中并编辑它。 See the "named.conf用于 TCP/IP 的文件格式" in the 文件参考 for more information and a detailed example of a conf file.
    • /etc/named.conf 文件(该文件列表接收转发请求的名称服务器的 IP 地址)的选项节中指定转发机行。 例如:
      options {
          ...
          directory "/usr/local/domain";
          forwarders { 192.100.61.1; 129.35.128.222; };
          ...
      };
    • 指定回送区域。 例如:
      zone "0.0.127.in-addr.arpa" in {
          type master;
          file "named.abc.local";
      };
    • 指定提示区域。 例如:
      zone "." IN {
          type hint;
          file "named.ca";
      };
  2. 编辑 /usr/local/domain/named.ca 文件。 有关更多信息和缓存文件的详细示例,请参阅文件参考中的"TCP/IP 的 DOMAIN 缓存文件格式"

    此文件包含作为网络根域的权威名称服务器的服务器地址。 例如:

    ; root name servers.
    .          IN    NS    relay.century.com.
    relay.century.com.   3600000    IN    A     129.114.1.2
    注意: 该文件中的所有行必须使用标准资源记录格式。
  3. 编辑 /usr/local/domain/named.abc.local 文件。
    See the DOMAIN TCP/IP 本地数据文件格式 in the 文件参考 for more information and a detailed 范例 of a local data file.
    1. 指定该区域的权限开始 (SOA) 及缺省的生存时间信息。 例如:
      $TTL 3h    ;3 hour
      
      @ IN SOA venus.abc.aus.century.com. gail.zeus.abc.aus.century.com.  (
      
                                 1       ;serial
                                 3600    ;refresh
                                 600     ;retry
                                 3600000 ;expire
                                 86400   ;negative caching TTL
      )
    2. 指定名称服务器 (NS) 记录。 例如:
      <tab>	IN    NS     venus.abc.aus.century.com.
    3. 指定指针 (PTR) 记录。
      1      IN    PTR    localhost.
      注意: 该文件中的所有行必须使用标准资源记录格式。
  4. 输入以下命令,创建 /etc/resolv.conf 文件:
    touch /etc/resolv.conf

    该文件的出现表示主机应该使用名称服务器,而不是 /etc/hosts 文件来进行名称解析。

    或者,/etc/resolv.conf 文件可以包含以下条目:

    nameserver 127.0.0.1

    127.0.0.1 地址是回送地址,它使主机以名称服务器的身份访问自己。 /etc/resolv.conf 文件也可包含如下条目:

    domain domainname

    在上述示例中,domainname 值是 austin.century.com

  5. 执行下列步骤之一:
    • 使用 smit stnamed SMIT 快速路径启用 named 守护进程。 这将在每次系统启动时初始化守护程序。 指示想要在现在或下次系统重新启动时启动 named 守护程序,或两次都启动。
    • 编辑 /etc/rc.tcpip 文件。 通过除去以下行中的注释 (#) 符号,取消 named 守护程序的行注解。
      #start /etc/named "$src_running"

      这将在每次系统启动时初始化守护程序。

  6. 如果不选择通过 SMIT 初始化 named 守护程序,输入下列命令为此会话启动守护程序。
    startsrc -s named