computers:dns_server_configuration
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
computers:dns_server_configuration [2012/06/13 14:47] – [Configuration] 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 { | ||
- | // Academia Sinica | + | |
- | 140.109.13.10; | + | 8.8.8.8; |
- | 140.109.1.10; | + | 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 76: | Line 146: | ||
===== References ===== | ===== References ===== | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
computers/dns_server_configuration.1339570079.txt.gz · Last modified: 2012/06/13 14:47 by chkuo