差異處
這裏顯示兩個版本的差異處。
| 兩邊的前次修訂版 前次修改 下次修改 | 前次修改 | ||
| bind [2017/01/03 22:12] – 127.0.0.1 | bind [2017/01/10 22:47] (目前版本) – jz | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| - | BIND | + | ====== |
| - | + | ||
| - | ====== | + | |
| + | ==== 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 | ||
| + | named-checkzone localhost / | ||
| + | </ | ||
| - | ====== set directory ====== | + | ==== Set directory ==== |
| + | ''/ | ||
| < | < | ||
| options { | options { | ||
| - | | + | |
| - | // if any, and should be fully qualified. | + | |
| directory | directory | ||
| ... | ... | ||
| 行 22: | 行 28: | ||
| </ | </ | ||
| - | ====== debug config ====== | + | ==== Logging config for debug ==== |
| + | create log file manually | ||
| + | |||
| + | <code bash> | ||
| + | touch / | ||
| + | chown bind:bind / | ||
| + | </ | ||
| + | |||
| + | ''/ | ||
| < | < | ||
| logging { | logging { | ||
| 行 28: | 行 42: | ||
| file "/ | file "/ | ||
| severity info; | severity info; | ||
| + | print-category yes; | ||
| print-severity | print-severity | ||
| print-time yes; | print-time yes; | ||
| 行 38: | 行 53: | ||
| </ | </ | ||
| - | # zone | + | ==== Zone config ==== |
| + | ''/ | ||
| < | < | ||
| zone " | zone " | ||
| 行 44: | 行 60: | ||
| file " | file " | ||
| }; | }; | ||
| - | </ | ||
| - | ====== | + | zone " |
| + | type master; | ||
| + | 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 | ||
| 行 60: | 行 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:// | ||