LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 729|回复: 2

简单的DNS配置说明和相关文件范例

[复制链接]
发表于 2003-9-4 12:03:46 | 显示全部楼层 |阅读模式
DNS服务器版本是 bind.9.2.x ,RH和MDK的最高版本现在大概都是它。

配置一个test.com的域
在该域下建立一个HOST:root.test.com,指向192.168.1.254
把该域的NS指向root.test.com
把该域的MX指向root.test.com

我没有设置test.com的反向解析,因为我用不上,如果大家想设置,可以参考/var/named/named.local,也很简单的~

以后我会在该贴针对DNS的一些相关问题做些补充。

下面是配置文件范例
 楼主| 发表于 2003-9-4 12:04:34 | 显示全部楼层

/etc/named.conf


  1. // generated by named-bootconf.pl

  2. options {
  3.         directory "/var/named";
  4.         /*
  5.          * If there is a firewall between you and nameservers you want
  6.          * to talk to, you might need to uncomment the query-source
  7.          * directive below.  Previous versions of BIND always asked
  8.          * questions using port 53, but BIND 8.1 uses an unprivileged
  9.          * port by default.
  10.          *
  11.          query-source address * port 53;
  12.         forward first;
  13.         forwarders {
  14.                 202.96.209.6;
  15.         };
  16.         fetch-glue no;
  17.         recursion no;*/
  18.         allow-query {192.168.88/24;192.168.1/24;127.0.0/8;};
  19.         allow-transfer {192.168.1.100;};
  20.         transfer-format        many-answers;
  21. };

  22. //
  23. // a caching only nameserver config
  24. //
  25. controls {
  26.         inet 127.0.0.1 allow { localhost; } keys { rndckey; };
  27. };
  28. zone "." IN {
  29.         type hint;
  30.         file "named.ca";
  31. };

  32. zone "localhost" IN {
  33.         type master;
  34.         file "localhost.zone";
  35.         allow-update { none; };
  36. };
  37. zone "0.0.127.in-addr.arpa" IN {
  38.         type master;
  39.         file "named.local";
  40.         allow-update { none; };
  41. };
  42. zone "test.com"        IN {
  43.         type master;
  44.         file "test.com.zone";
  45.         allow-update { none; };
  46. };
  47. include "/etc/rndc.key";
复制代码
 楼主| 发表于 2003-9-4 12:06:21 | 显示全部楼层

/var/named/test.com.zone



  1. $TTL 86400
  2. @        IN        SOA root.test.com. mail.root.test.com. (
  3.                         1 ; serial
  4.                         28800 ; refresh
  5.                         7200 ; retry
  6.                         604800 ; expire       
  7.                         86400 ; ttl
  8.                         )

  9.         IN        NS        root.test.com.
  10.         IN        NS        root.test.com.
  11.         IN        A        192.168.1.254

  12. root        IN        A        192.168.1.254
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表