bind

差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

兩邊的前次修訂版 前次修改
下次修改
前次修改
bind [2017/01/03 23:56] 127.0.0.1bind [2017/01/10 22:47] (目前版本) jz
行 1: 行 1:
 ====== BIND ====== ====== BIND ======
  
- +==== Install ==== 
-==== install ==== +<code>
 pkg install bind911 pkg install bind911
 sysrc named_enable="YES" sysrc named_enable="YES"
 +</code>
  
-==== generate key (note that the service start will do that) ====+==== Generate key (note that the service start will do that) ==== 
 +<code>
 rndc-confgen -a rndc-confgen -a
 +</code>
  
-==== check config ====+==== Check config ====
 <code> <code>
 named-checkconf named-checkconf
行 16: 行 18:
 </code> </code>
  
-==== set directory ====+==== Set directory ==== 
 +''/usr/local/etc/namedb/named.conf''
 <code> <code>
 options { options {
-        // All file and path names are relative to the chroot directory, +        ...
-        // if any, and should be fully qualified.+
         directory       "/usr/local/etc/namedb";         directory       "/usr/local/etc/namedb";
         ...         ...
行 26: 行 28:
 </code> </code>
  
-==== debug config ====+==== Logging config for debug ==== 
 +create log file manually 
 + 
 +<code bash> 
 +touch /var/log/named.log 
 +chown bind:bind /var/log/named.log 
 +</code> 
 + 
 +''/usr/local/etc/namedb/named.conf''
 <code> <code>
 logging { logging {
行 32: 行 42:
         file "/var/log/named.log" versions 10 size 200m;         file "/var/log/named.log" versions 10 size 200m;
         severity info;         severity info;
 +        print-category yes;
         print-severity  yes;         print-severity  yes;
         print-time yes;         print-time yes;
行 42: 行 53:
 </code> </code>
  
-# zone+==== Zone config ==== 
 +''/usr/local/etc/namedb/named.conf''
 <code> <code>
 zone "example.org" { zone "example.org" {
         type master;         type master;
         file "master/example.org";         file "master/example.org";
 +};
 +
 +zone "1.168.192.in-addr.arpa" {
 + type master;
 + file "master/1.168.192.in-addr.arpa";
 }; };
 </code> </code>
  
-==== zone file ==== +==== Zone file ==== 
 +''/usr/local/etc/namedb/master/example.org''
 <code> <code>
 $TTL 3600        ; 1 hour default TTL $TTL 3600        ; 1 hour default TTL
 example.org.    IN      SOA      ns1.example.org. admin.example.org. ( example.org.    IN      SOA      ns1.example.org. admin.example.org. (
-                                2006051501      ; Serial+                                2017010301      ; Serial
                                 10800           ; Refresh                                 10800           ; Refresh
                                 3600            ; Retry                                 3600            ; Retry
行 64: 行 81:
 ; DNS Servers ; DNS Servers
                 IN      NS      ns1.example.org.                 IN      NS      ns1.example.org.
-                IN      NS      ns2.example.org. 
  
 ; MX Records ; MX Records
                 IN      MX 10   mx.example.org.                 IN      MX 10   mx.example.org.
                 IN      MX 20   mail.example.org.                 IN      MX 20   mail.example.org.
- 
-                IN      A       192.168.1.1 
  
 ; Machine Names ; Machine Names
-localhost       IN      A       127.0.0.1+@               IN      A       192.168.1.1
 ns1             IN      A       192.168.1.2 ns1             IN      A       192.168.1.2
-ns2             IN      A       192.168.1.3 +mail            IN      A       192.168.1.3
-mx              IN      A       192.168.1.4 +
-mail            IN      A       192.168.1.5+
  
 ; Aliases ; Aliases
 www             IN      CNAME   example.org. www             IN      CNAME   example.org.
 </code> </code>
 +
 +==== reverse zone file ====
 +''/usr/local/etc/namedb/master/1.168.192.in-addr.arpa''
 +<code>
 +@       IN      SOA     example.org. admin.example.org. (
 +                              2017010301      ; serial
 +                              14400           ; refresh
 +                              3600            ; retry
 +                              604800          ; expire
 +                              10800           ; minimum
 +)
 + 
 +1.168.192.in-addr.arpa.      IN      NS      ns1.example.org.
 +2                            IN      PTR     ns1.example.org.
 +3                            IN      PTR     mail.example.org.
 +</code>
 +
 +==== Start service ====
 +<code bash>
 +service named start
 +</code>
 +
  
 [[http://wiki.weithenn.org/cgi-bin/wiki.pl?bind9-%E6%8F%90%E4%BE%9BDomain_Name%E8%88%87IP%E5%B0%8D%E6%87%89%E7%9A%84%E6%9C%8D%E5%8B%99|bind 安全設定]] [[http://wiki.weithenn.org/cgi-bin/wiki.pl?bind9-%E6%8F%90%E4%BE%9BDomain_Name%E8%88%87IP%E5%B0%8D%E6%87%89%E7%9A%84%E6%9C%8D%E5%8B%99|bind 安全設定]]
  • bind.1483459016.txt.gz
  • 上一次變更: 2017/01/03 23:56
  • 127.0.0.1