vestacp open: /etc/named.conf: permission denied

This was the error I was getting after a doing a little change in the named.conf in my newly installed vesta control panel. While restarting the named, I was getting this error-

[root@vesta2 ~]# systemctl status named.service
● named.service - Berkeley Internet Name Domain (DNS)
Loaded: loaded (/usr/lib/systemd/system/named.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2022-08-01 14:37:25 +06; 6s ago
Process: 3478 ExecStart=/usr/sbin/named -u named -c ${NAMEDCONF} $OPTIONS (code=exited, status=1/FAILURE)
Process: 3475 ExecStartPre=/bin/bash -c if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z "$NAMEDCONF"; else echo "Checking of zone files is disabled"; fi (code=exited, status=0/SUCCESS)

Aug 01 14:37:25 named[3480]: found 2 CPUs, using 2 worker threads
Aug 01 14:37:25 named[3480]: using 1 UDP listener per interface
Aug 01 14:37:25 named[3480]: using up to 21000 sockets
Aug 01 14:37:25 named[3480]: loading configuration from '/etc/named.conf'
Aug 01 14:37:25 named[3480]: open: /etc/named.conf: permission denied
Aug 01 14:37:25 named[3480]: loading configuration: permission denied
Aug 01 14:37:25 systemd[1]: named.service: control process exited, code=exited status=1
Aug 01 14:37:25 systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
Aug 01 14:37:25 systemd[1]: Unit named.service entered failed state.
Aug 01 14:37:25 systemd[1]: named.service failed.


Step-1: Execute the following command-

restorecon -RFv /etc/named.conf

Step-2: Setting permission-

chmod 644 /etc/named.conf

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.