Ubuntu – Isc_stdio_open ‘/var/log/bind9/query.log’ failed: permission denied



/var/log/bind9/** rw,
/var/log/bind9/ rw,

options {
        directory "/var/cache/bind";
        auth-nxdomain no;
        listen-on-v6 { any; };
        statistics-file "/var/cache/bind/named.stats";
        rrset-order {order cyclic;};
    allow-transfer {; };
logging {
        channel b_query {
                file "/var/log/bind9/query.log" versions 2 size 1m;
                print-time yes;
                severity info;
        category queries { b_query; };

service bind9 status

isc_stdio_open '/var/log/bind9/query.log' failed: permission denied

I have already created bind9 in /var/log and added root:bind with permission 755

I have already restarted apparmor and bind9
Same error.
What is wrong ?

Best Answer

  • On /etc/apparmor.d/usr.sbin.named

    /var/log/named/** rw,
    /var/log/named/ rw,

    You must adjust permissions or dir here.

    Some people like to put logs in /var/log/named/ instead of having syslog do the heavy lifting.

  • Related Question