BIND域名服务器配置
gugong
|
1#
gugong 发表于 2003-12-10 14:29
BIND域名服务器配置
在 “动态域名更新(DDNS+DHCPD)”的这个
http://www.linuxfans.org/nuke/modules.php?name=Forums&file=viewtopic&t=13288 帖子里,我大概地写了 bind 的配置,这里详细地写一个。 本 人 申 明 : 我这里的例子均是本人在实际环境里面使用过的,只是改变了yourdomaon.com、1.2.3 等。 所以您可以完全拷贝我的。 然后将 “yourdomaon.com” 改成你的“域名”; 将“1.2.3”、“3.2.1” 改成您的(比如)“192.168.0”、“0.168.192”(私网和公网均可) 即可! 所用到的文件 : [code:1] 3.2.1 29-Jan-2002 17:04 745 127.0.0 29-Jan-2002 17:00 278 localdomain 29-Jan-2002 17:00 296 named.ca 04-Jul-2001 04:56 2.7K named.conf 20-Dec-2002 13:21 3.2K named.root 04-Jul-2001 04:56 2.7K yourdomain.com 29-Jan-2002 17:04 953 [/code:1] named.cond 文件内容: [code:1]# # file: /etc/named.conf # # It's ONLY for reference. ------------- gugong # controls { inet 127.0.0.1 allow { localhost; } keys { rndckey; }; }; include "/etc/rndc.key"; logging { channel gugong_update_debug { file "/var/named/update-debug.log"; #您须手工 touch 此文件,然后改为 named 用户所有,下同。 severity debug 3 ; print-category yes; print-severity yes; print-time yes; }; channel gugong_security_info { file "/var/named/named-auth.log"; severity info; print-category yes; print-severity yes; print-time yes; }; channel gugong_queries_info { file "/var/named/queries.log"; severity info; print-category yes; print-severity yes; print-time yes; }; channel gugong_default_info { file "/var/named/named-default.log"; severity info; print-category yes; print-severity yes; print-time yes; }; category update { gugong_default_info; gugong_update_debug; default_syslog; default_stderr; }; category security { gugong_security_info; default_debug; default_syslog; }; category queries { gugong_queries_info; # default_syslog; default_debug; }; category lame-servers { gugong_queries_info; default_syslog; }; category default { gugong_default_info; default_syslog; default_debug; default_stderr; }; # 不同的 bind 版本,可能上面的有些不能用,注释掉不能用的即可。 }; # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ options { directory "/etc/named"; # 指定域名解析文件的存放目录为 "/etc/named"。 /* * If there is a firewall between you and nameservers you want * to talk to, you might need to uncomment the query-source * directive below. Previous versions of BIND always asked * questions using port 53, but BIND 8.1 uses an unprivileged * port by default. */ // query-source address * port 53; auth-nxdomain yes; # check-names master fail; # check-names slave warn; # check-names response ignore; # # 可以指定在哪个地址监听。 # listen-on port 53 { 127.0.0.1; 192.168.0.251; }; # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # ======================================================================== # 提供 “域名解析转发”。 # 这在若你没有直接连接到互联网时会特别管用。 # 当然您也可以指定这里,来减少您服务器的 DNS 解析的网络流量。 # # forward first; # forwarders { 192.168.0.1; 192.168.0.2; }; # # # rfc2308-type1 yes; # no }; # acl local_host_name { 192.168.0.0/24; # !192.168.1.239; }; # zone "yourdomain.com" in { type master; file "master/yourdomain"; # allow-update { local_host_name; }; # check-names warn; # ( warn | fail | ignore ); }; # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ zone "3.2.1.in-addr.arpa" { type master; notify no; file "master/3.2.1"; # allow-update { local_host_name; }; # check-names warn; # ( warn | fail | ignore ); }; # ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ # # hint file (formerly known as cache file) zone "." { type hint; file "named.ca"; # check-names warn; # ( warn | fail | ignore ); }; # /* localhost */ zone "0.0.127.in-addr.arpa" { type master; notify no; file "master/127.0.0"; }; # /* localhost.localdomain */ zone "localdomain" { type master; notify no; file "master/localdomain"; }; # ------------------------ END ------------------------ [/code:1] |