zone example.com/IN: loading from master file /home/admin/conf/dns/example.com.db failed: permission denied

Date Posted: 05-10-2017

Assumptions:-

We assume that you have the following setup

  • VestaCP
  • Ubuntu 16.04
  • Bind9

Error:-

Bind might refuse to reload due to below errors

zone example.com/IN: loading from master file /home/admin/conf/dns/example.com.db failed: permission denied

 

Fix:-

Check permission and it seems fine. Else you need correct it accordingly

root@server:/home/admin/conf/dns# ll
total 12
drwxr-x--x 2 root root 4096 Nov 28 13:09 ./
drwxr-xr-x 5 root root 4096 Nov  9 19:10 ../
-rw-r----- 1 root bind  645 Nov 28 13:09 example.com.db

 

Check bind and make sure its running fine

root@server:/home/admin/conf/dns# ps aux | grep bind
bind     16679  0.0  0.3 238688 13692 ?        Ssl  13:18   0:00 /usr/sbin/named -u bind
root     17918  0.0  0.0  11740   936 pts/2    S+   13:33   0:00 grep --color=auto bind

The real issue is that we need to allow zone files inĀ apparmor security module. Because in vestaCP zone files are stored under /home/admin/conf/dns.

To allow this:-

In /etc/apparmor.d/usr.sbin.named

Find the line ‘/etc/bind/** rw,'and add this line below

/home/** rwm,

Restart service

systemctl restart apparmor

Now verify restarting bind service

systemctl restart bind9

You’re done.

Leave a Reply