User Tools

Site Tools


computers:dns_server_configuration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
computers:dns_server_configuration [2020/08/13 17:22] chkuocomputers: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 install bind9 +sudo apt install bind9 bind9utils bind9-doc bind9-host dnsutils
-sudo apt install dnsutils+
 </code> </code>
  
Line 59: Line 58:
 <code bash> <code bash>
 sudo mkdir -p /var/log/named sudo mkdir -p /var/log/named
 +sudo chown bind:bind /var/log/named
 </code> </code>
- 
-restart service 
-<code bash> 
-sudo /etc/init.d/bind9 restart 
-</code> 
- 
 note: note:
-the log directory "/var/log/named" is hard-coded in ''/etc/apparmor.d/cat usr.sbin.named''+the log directory "/var/log/named" is hard-coded in ''/etc/apparmor.d/usr.sbin.named''
 <code bash> <code bash>
   # some people like to put logs in /var/log/named/ instead of having   # some people like to put logs in /var/log/named/ instead of having
Line 75: Line 69:
 </code> </code>
 this part would need to be changed if a custom log directory is used. this part would need to be changed if a custom log directory is used.
-===== Activation ===== + 
-To start/stop/restart the service:+ 
 +start service 
 +<code bash> 
 +# enable auto start at boot time: 
 +sudo systemctl enable named 
 +# start 
 +sudo systemctl start named 
 +</code> 
 + 
 +check status 
 +<code bash> 
 +systemctl status named 
 +</code> 
 + 
 +check the "Current DNS Server" 
 +<code bash> 
 +systemd-resolve --status 
 +</code> 
 + 
 +To set BIND as the default resolver, edit ''/etc/systemd/resolved.conf'' 
 +In the [Resolve] section, add ''DNS=127.0.0.1''
 <code bash> <code bash>
-sudo /etc/init.d/bind9 start +# restart and check again 
-sudo /etc/init.d/bind9 stop +sudo systemctl restart systemd-resolved 
-sudo /etc/init.d/bind9 restart+systemd-resolve --status
 </code> </code>
  
Line 132: Line 146:
 ===== References ===== ===== References =====
   * [[https://help.ubuntu.com/10.04/serverguide/C/dns.html]]   * [[https://help.ubuntu.com/10.04/serverguide/C/dns.html]]
 +  * [[https://www.linuxbabe.com/ubuntu/set-up-local-dns-resolver-ubuntu-20-04-bind9]]
  
  
computers/dns_server_configuration.1597310556.txt.gz · Last modified: 2020/08/13 17:22 by chkuo