named stopped working

I have a computer with named working as my dns, I have noticed some delays in my clients so I make a query to the dns server and see that it was down, then I tried to start it but it failed

aldebaran:~ # journalctl -xeu named.service
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- A start job for unit named.service has finished with a failure.
-- 
-- The job identifier is 249 and the job result is failed.
Aug 11 09:37:24 aldebaran systemd[1]: Starting Berkeley Internet Name Domain (DNS)...
-- Subject: A start job for unit named.service has begun execution
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- A start job for unit named.service has begun execution.
-- 
-- The job identifier is 2045847.
Aug 11 09:37:24 aldebaran named.prep[3194]: /usr/lib/bind/named.prep: line 33: /usr/share/bind/createNamedConfInclude: No such file or directory
Aug 11 09:37:25 aldebaran systemd[1]: named.service: Control process exited, code=exited, status=6/NOTCONFIGURED
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- An ExecStartPre= process belonging to unit named.service has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 6.
Aug 11 09:37:25 aldebaran systemd[1]: named.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- The unit named.service has entered the 'failed' state with result 'exit-code'.
Aug 11 09:37:25 aldebaran systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
-- Subject: A start job for unit named.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- A start job for unit named.service has finished with a failure.
-- 
-- The job identifier is 2045847 and the job result is failed.
aldebaran:~ #

As the error seems to be “/usr/lib/bind/named.prep: line 33: /usr/share/bind/createNamedConfInclude: No such file or directory” in sysconfig I search for named and I find that NAMED_INITIALIZA_SCRIPTS value is createNamedConfInclude. I remove createNamedConfInclude from there and try t start again named but

aldebaran:~ # systemctl status named.service
x 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 Thu 2022-08-11 09:55:34 CEST; 11s ago
    Process: 4036 ExecStartPre=/usr/lib/bind/named.prep (code=exited, status=6)

Aug 11 09:55:33 aldebaran systemd[1]: Starting Berkeley Internet Name Domain (DNS)...
Aug 11 09:55:34 aldebaran systemd[1]: named.service: Control process exited, code=exited, status=6/NOTCONFIGURED
Aug 11 09:55:34 aldebaran systemd[1]: named.service: Failed with result 'exit-code'.
Aug 11 09:55:34 aldebaran systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
aldebaran:~ # 

Still an error. It says it is not configured but it was configured and working. I open the configuration from yast and it is there.
Last lines in /var/lib/named/log/default.log are two day ago:

09-Jul-2022 11:29:55.001 lame-servers: info: REFUSED unexpected RCODE resolving '24.66.125.45.in-addr.arpa/PTR/IN': 141.98.8.30#53
09-Jul-2022 11:35:00.867 general: info: received control channel command 'stop'
09-Jul-2022 11:35:01.003 network: info: no longer listening on 127.0.0.1#53
09-Jul-2022 11:35:01.463 network: info: no longer listening on 192.168.2.5#53
09-Jul-2022 11:35:01.627 network: info: no longer listening on 172.17.0.1#53
09-Jul-2022 11:35:01.627 general: info: shutting down: flushing changes
09-Jul-2022 11:35:01.627 general: notice: stopping command channel on 127.0.0.1#953
09-Jul-2022 11:35:02.827 general: notice: exiting

The files related to bind

**aldebaran:~ #** ls /etc/named* -l 
-rw-r--r-- 1 root root  4908 Aug 11 10:11 /etc/named.conf 
-rw-r--r-- 1 root root  5141 Aug 11 10:08 /etc/named.conf.YaST-backup 
-rw-r--r-- 1 root named 5616 Aug  3 17:29 /etc/named.conf.rpmnew 
-rw-r--r-- 1 root named 3969 Jun 22  2017 /etc/named.conf.rpmsave 
-rw-r--r-- 1 root root  4908 Aug 11 10:10 /etc/named.conf.yast2-save 
-rw------- 1 root root  5049 Jan  2  2021 /etc/named.conf~ 

/etc/named.d: 
total 4 
lrwxrwxrwx 1 root root  39 Aug 29  2019 forwarders.conf -> /var/run/netconfig/bind-forwarders.conf 
-rw-r--r-- 1 root root 626 Oct  9  2003 rndc-access.conf 
**aldebaran:~ #** 

I edit dns server configuration from yast and try to change something, for instance “After writing configuration” is set to “keep current” state and I change to “Start” and it says “Saving the configuration failed” but it gives me no more information about the error.

What can I do?

Thanks

@fperal:

The systemd Journal has a fairly clear answer:


Aug 11 09:37:24 aldebaran named.prep[3194]: /usr/lib/bind/named.prep: line 33: **/usr/share/bind/createNamedConfInclude**: No such file or directory
Aug 11 09:37:25 aldebaran systemd[1]: named.service: Control process exited, code=exited, status=6/NOTCONFIGURED
-- Subject: Unit process exited

You’ll need to check which RPM package provides the file ‘/usr/share/bind/createNamedConfInclude’ –

 > rpm --query --whatprovides /usr/share/bind/createNamedConfInclude

Then, forcibly re-install the damaged package.

You can run /usr/sbin/named-checkconf to see if it returns any error.

**aldebaran:~ #** rpm --query --whatprovides /usr/share/bind/createNamedConfInclude 
error: file /usr/share/bind/createNamedConfInclude: No such file or directory 
**aldebaran:~ #** rpm --query --whatprovides createNamedConfInclude                 
no package provides createNamedConfInclude 
**aldebaran:~ #** 



**aldebaran:~ #** /usr/sbin/named-checkconf 
/etc/named.conf:168: open: /etc/named.conf.include: file not found

so I edited named.conf, deleted the line at #168

[FONT=monospace] 
#include "/etc/named.conf.include";

and

**aldebaran:~ #** systemctl start named.service    
**aldebaran:~ #** systemctl status named.service 
***** named.service - Berkeley Internet Name Domain (DNS) 
     Loaded: loaded (/usr/lib/systemd/system/named.service; enabled; vendor preset: disabled) 
     Active: **active (running)** since Thu 2022-08-11 15:58:15 CEST; 15s ago 
    Process: 19963 ExecStartPre=/usr/lib/bind/named.prep (code=exited, status=0/SUCCESS) 
    Process: 19966 ExecStart=/usr/sbin/named -u named $NAMED_ARGS (code=exited, status=0/SUCCESS) 
   Main PID: 19967 (named) 
      Tasks: 10 (limit: 4915) 
     CGroup: /system.slice/named.service 
             `-19967 /usr/sbin/named -u named 

Aug 11 15:58:15 aldebaran named[19967]: automatic empty zone: A.E.F.IP6.ARPA 
Aug 11 15:58:15 aldebaran named[19967]: automatic empty zone: B.E.F.IP6.ARPA 
Aug 11 15:58:15 aldebaran named[19967]: automatic empty zone: 8.B.D.0.1.0.0.2.IP6.ARPA 
Aug 11 15:58:15 aldebaran named[19967]: automatic empty zone: EMPTY.AS112.ARPA 
Aug 11 15:58:15 aldebaran named[19967]: automatic empty zone: HOME.ARPA 
Aug 11 15:58:15 aldebaran named[19967]: configuring command channel from '/etc/rndc.key' 
Aug 11 15:58:15 aldebaran named[19967]: **command channel listening on 127.0.0.1#953** 
Aug 11 15:58:15 aldebaran named[19967]: configuring command channel from '/etc/rndc.key' 
Aug 11 15:58:15 aldebaran named[19967]: **command channel listening on ::1#953** 
Aug 11 15:58:15 aldebaran systemd[1]: Started Berkeley Internet Name Domain (DNS). 
**aldebaran:~ #** 



working!

thanks
[/FONT]

Just for others running in the same pitfall: I updated Leap 15.3 to 15.4 with an existing and working bind.

However, because the Script “/usr/share/bind/createNamedConfInclude” is not provided anymore (and the present one from 15.3 will get deleted!) you will receive this error, simply because “named.conf.include” is still present and included in the config (at least with me). Because of that, obviously in “/etc/sysconfig/named” the entry NAMED_INITIALIZE_SCRIPTS=“createNamedConfInclude” is added, with that script not present. It’s a kind of circle error.

To fix this:
Step 1: delete the include statement in /etc/named.conf
Step 2: delete the include file /etc/named.conf.include
Step 3: edit /etc/sysconfig/named and change NAMED_INITIALIZE_SCRIPTS=“createNamedConfInclude” to NAMED_INITIALIZE_SCRIPTS=""createNamedConfInclude

With these three steps, the problem was solved for me.

BTW: the installer will create a new /etc/named.conf.rpmnew where the include statement is missing. However, if you compare the old and new config files to simply add missing things in your existing config (because it’s quite big and worked…) you will probably not remove the include statement yourself. And why should an include directive for an empty file do any harm anyways, right?