computers:dns_server_configuration
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| computers:dns_server_configuration [2011/08/26 10:56] – created chkuo | computers:dns_server_configuration [2020/08/16 01:53] (current) – chkuo | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| Download and install the packages | Download and install the packages | ||
| <code bash> | <code bash> | ||
| - | sudo apt-get install bind9 | + | sudo apt install bind9 bind9utils bind9-doc bind9-host |
| - | sudo apt-get install | + | |
| </ | </ | ||
| ===== Configuration ===== | ===== Configuration ===== | ||
| - | To setup a caching nameserver, add the IP addresses of the ISP's (e.g., Academia Sinica) DNS servers. Uncomment and edit the following in ''/ | ||
| + | ==== DNS Forwarders ==== | ||
| + | To setup a caching nameserver, add the IP addresses of the ISP's (e.g., Academia Sinica) DNS servers. Uncomment and edit the following in ''/ | ||
| <code bash> | <code bash> | ||
| forwarders { | forwarders { | ||
| - | 140.109.13.10; | + | |
| - | 140.109.1.10; | + | 8.8.8.8; |
| + | 8.8.4.4; | ||
| }; | }; | ||
| </ | </ | ||
| - | ===== Activation ===== | + | ==== Logging |
| - | To start/stop/restart | + | |
| + | add the following code to '' | ||
| + | <code bash> | ||
| + | logging { | ||
| + | channel default-log { | ||
| + | file "/ | ||
| + | severity info; | ||
| + | print-time yes; | ||
| + | }; | ||
| + | channel lamer-log { | ||
| + | file"/ | ||
| + | severity info; | ||
| + | print-severity yes; | ||
| + | print-time yes; | ||
| + | print-category yes; | ||
| + | }; | ||
| + | channel query-log { | ||
| + | file "/ | ||
| + | severity info; | ||
| + | print-time yes; | ||
| + | }; | ||
| + | channel security-log { | ||
| + | file"/ | ||
| + | severity info; | ||
| + | print-severity yes; | ||
| + | print-time yes; | ||
| + | print-category yes; | ||
| + | }; | ||
| + | category default { default-log; | ||
| + | category lame-servers { lamer-log; }; | ||
| + | category queries { query-log; | ||
| + | category security { security-log; | ||
| + | }; | ||
| + | </ | ||
| + | |||
| + | prepare log directory: | ||
| + | <code bash> | ||
| + | sudo mkdir -p / | ||
| + | sudo chown bind:bind / | ||
| + | </ | ||
| + | note: | ||
| + | the log directory "/ | ||
| + | <code bash> | ||
| + | # some people like to put logs in / | ||
| + | # syslog do the heavy lifting. | ||
| + | / | ||
| + | / | ||
| + | </ | ||
| + | this part would need to be changed if a custom log directory is used. | ||
| + | |||
| + | |||
| + | start service | ||
| + | <code bash> | ||
| + | # enable auto start at boot time: | ||
| + | sudo systemctl enable named | ||
| + | # start | ||
| + | sudo systemctl start named | ||
| + | </ | ||
| + | |||
| + | check status | ||
| + | <code bash> | ||
| + | systemctl status named | ||
| + | </ | ||
| + | |||
| + | check the " | ||
| + | <code bash> | ||
| + | systemd-resolve --status | ||
| + | </ | ||
| + | |||
| + | To set BIND as the default resolver, edit ''/ | ||
| + | In the [Resolve] section, add '' | ||
| <code bash> | <code bash> | ||
| - | sudo / | + | # restart and check again |
| - | sudo / | + | sudo systemctl restart systemd-resolved |
| - | sudo / | + | systemd-resolve --status |
| </ | </ | ||
| Line 75: | Line 146: | ||
| ===== References ===== | ===== References ===== | ||
| * [[https:// | * [[https:// | ||
| + | * [[https:// | ||
computers/dns_server_configuration.1314327415.txt.gz · Last modified: by chkuo