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 [2017/08/01 14:53] – 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 | + | |
</ | </ | ||
Line 24: | Line 23: | ||
add the following code to ''/ | add the following code to ''/ | ||
<code bash> | <code bash> | ||
- | logging | + | logging { |
- | { | + | channel default-log { |
- | channel default-log { | + | file "/ |
- | file "/ | + | severity info; |
- | severity info; | + | print-time yes; |
- | print-time yes; | + | }; |
- | }; | + | channel lamer-log { |
- | channel lamer-log { | + | file"/ |
- | file"/ | + | severity info; |
- | severity info; | + | print-severity yes; |
- | print-severity yes; | + | print-time yes; |
- | print-time yes; | + | print-category yes; |
- | print-category yes; | + | }; |
- | }; | + | channel query-log { |
- | channel query-log { | + | file "/ |
- | file "/ | + | severity info; |
- | severity info; | + | print-time yes; |
- | print-time yes; | + | }; |
- | | + | channel security-log { |
- | channel security-log { | + | file"/ |
- | file"/ | + | severity info; |
- | severity info; | + | print-severity yes; |
- | print-severity yes; | + | print-time yes; |
- | print-time yes; | + | print-category yes; |
- | print-category yes; | + | }; |
- | }; | + | category default { default-log; |
- | category default { default-log; | + | category lame-servers { lamer-log; }; |
- | category lame-servers { lamer-log; }; | + | category queries { query-log; |
- | category queries { query-log; | + | category security { security-log; |
- | category security { security-log; | + | |
}; | }; | ||
</ | </ | ||
Line 59: | Line 57: | ||
prepare log directory: | prepare log directory: | ||
<code bash> | <code bash> | ||
- | sudo mkdir -p /var/log/bind | + | sudo mkdir -p /var/log/named |
- | sudo chown bind:bind /var/log/bind | + | sudo chown bind:bind /var/log/named |
+ | </ | ||
+ | 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 | ||
</ | </ | ||
- | ===== Activation ===== | + | To set BIND as the default resolver, edit '' |
- | To start/stop/restart | + | 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 120: | Line 146: | ||
===== References ===== | ===== References ===== | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
computers/dns_server_configuration.1501570382.txt.gz · Last modified: 2017/08/01 14:53 by chkuo