差異處
這裏顯示兩個版本的差異處。
| 兩邊的前次修訂版 前次修改 下次修改 | 前次修改 | ||
| bind [2017/01/03 23:56] – 127.0.0.1 | bind [2017/01/10 22:47] (目前版本) – jz | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| ====== BIND ====== | ====== BIND ====== | ||
| - | + | ==== Install | |
| - | ==== install | + | < |
| pkg install bind911 | pkg install bind911 | ||
| sysrc named_enable=" | sysrc named_enable=" | ||
| + | </ | ||
| - | # generate | + | ==== Generate |
| + | < | ||
| rndc-confgen -a | rndc-confgen -a | ||
| + | </ | ||
| - | ==== check config ==== | + | ==== Check config ==== |
| < | < | ||
| named-checkconf | named-checkconf | ||
| 行 16: | 行 18: | ||
| </ | </ | ||
| - | ==== set directory ==== | + | ==== Set directory ==== |
| + | ''/ | ||
| < | < | ||
| options { | options { | ||
| - | | + | |
| - | // if any, and should be fully qualified. | + | |
| directory | directory | ||
| ... | ... | ||
| 行 26: | 行 28: | ||
| </ | </ | ||
| - | ==== debug config ==== | + | ==== Logging |
| + | create log file manually | ||
| + | |||
| + | <code bash> | ||
| + | touch / | ||
| + | chown bind:bind / | ||
| + | </ | ||
| + | |||
| + | ''/ | ||
| < | < | ||
| logging { | logging { | ||
| 行 32: | 行 42: | ||
| file "/ | file "/ | ||
| severity info; | severity info; | ||
| + | print-category yes; | ||
| print-severity | print-severity | ||
| print-time yes; | print-time yes; | ||
| 行 42: | 行 53: | ||
| </ | </ | ||
| - | # zone | + | ==== Zone config ==== |
| + | ''/ | ||
| < | < | ||
| zone " | zone " | ||
| type master; | type master; | ||
| file " | file " | ||
| + | }; | ||
| + | |||
| + | zone " | ||
| + | type master; | ||
| + | file " | ||
| }; | }; | ||
| </ | </ | ||
| - | ==== zone file ==== | + | ==== Zone file ==== |
| + | ''/ | ||
| < | < | ||
| $TTL 3600 ; 1 hour default TTL | $TTL 3600 ; 1 hour default TTL | ||
| example.org. | example.org. | ||
| - | | + | |
| 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 | IN MX 10 | ||
| IN MX 20 | IN MX 20 | ||
| - | |||
| - | IN A | ||
| ; Machine Names | ; Machine Names | ||
| - | localhost | + | @ IN A 192.168.1.1 |
| ns1 | ns1 | ||
| - | ns2 | + | mail IN A |
| - | mx IN A | + | |
| - | mail IN A | + | |
| ; Aliases | ; Aliases | ||
| www | www | ||
| </ | </ | ||
| + | |||
| + | ==== reverse zone file ==== | ||
| + | ''/ | ||
| + | < | ||
| + | @ | ||
| + | 2017010301 | ||
| + | 14400 ; refresh | ||
| + | 3600 ; retry | ||
| + | 604800 | ||
| + | 10800 ; minimum | ||
| + | ) | ||
| + | |||
| + | 1.168.192.in-addr.arpa. | ||
| + | 2 IN PTR | ||
| + | 3 IN PTR | ||
| + | </ | ||
| + | |||
| + | ==== Start service ==== | ||
| + | <code bash> | ||
| + | service named start | ||
| + | </ | ||
| + | |||
| [[http:// | [[http:// | ||