Get the BIND (named) service config files from redhat

shakaxl

New Member
Joined
Apr 13, 2021
Messages
18
Reaction score
3
Credits
179
Hello everyone


I have just been delegated the administration of a bind DNS server, it is redhat version 5.2. The problem is that I can't find the file known as named.conf anywhere, apparently it has a custom configuration.
The running process is named, is there any way to know what configuration file this process is running from?

Thank you very much for the information

If you need any additional information you need, do not hesitate to tell me
 


Usually you find this information in /etc/named.conf or under /etc/named/

I had a server once where the files were stored under /var/named/chroot/ also as I chrooted bind to that directory. It could be there.

Quick Linux trick. Make sure you have the program "mlocate" installed. Then run "sudo updatedb". Once that update completes, type: "locate named" and it should show you the location of any files that have the word "named" in them. (including directory paths)
 
Sorry for the delay dear @dcbrown73

It´s right, the directory where are the zones files is "/var/named/chroot/var/named" but there´s not a "named.conf" file

I have the next information

********
[root@s112vp5 named]# service named status
number of zones: 30
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
recursive clients: 0/1000
tcp clients: 0/100
server is up and running
named (pid 18030) is running...


*********

[root@s112vp5 named]# ps aux | grep nam
named 18030 0.0 0.6 38648 3376 ? Ssl Aug18 10:28 /usr/sbin/named -u named -t /var/named/chroot
root 18688 0.0 0.1 3908 652 pts/0 S+ 20:10 0:00 grep nam


*******

I want to have this information very clear, when we have issues I consider It´is important to troubleshooting

I hope you help, thanks in advance
 
I don't currently manage a named server, but did you try the mlocate utility I mentioned earlier?

Run the following two commands.
Code:
[user@server ~]$ sudo updatedb
[user@server ~]$ locate named.conf
/path/to/named.conf

If you get an error that updatedb doesn't exist. You would need to install mlocate.
Code:
[user@server ~]$ sudo yum install mlocate
{yum/dnf installing mlocate message}
[user@server ~]$ sudo updatedb
[user@server ~]$ locate named.conf
/path/to/named.conf
 
Dear @dcbrown73

I have the next output, I see several named.conf, what would be the original in use is this moment?


[root@s112vp2 ~]# locate named.conf
/etc/dbus-1/system.d/named.conf
/root/ns1_config/etc/named.conf
/root/ns1_config/etc/named.conf.old
/root/ns1_config/etc/named.conf.rpmsave
/root/ns1_config/etc/named.conf_010310
/root/ns1_config/etc/named.conf_051209
/root/ns1_config/etc/named.conf_150310
/root/ns1_config/etc/named.conf_230210
/root/ns1_config/etc/named.conf_240610
/root/ns1_config/etc/named.conf_260610
/root/ns1_config/etc/named.conf_260610a
/root/ns1_config/etc/named.conf_280409
/root/ns1_config/etc/named.conf_280510
/root/ns1_config/etc/named.conf_300310
/root/ns1bk/named.conf
/usr/share/doc/bind-9.3.4/sample/etc/named.conf
/usr/share/logwatch/default.conf/services/named.conf
/usr/share/man/man5/named.conf.5.gz
/var/named/chroot/etc/named.conf
/var/named/chroot/etc/named.conf_050920
/var/named/chroot/etc/named.conf_091111
/var/named/chroot/etc/named.conf_130511
/var/named/chroot/etc/named.conf_140115
/var/named/chroot/etc/named.conf_140611
/var/named/chroot/etc/named.conf_140814
/var/named/chroot/etc/named.conf_20161230
/var/named/chroot/etc/named.conf_20170102
/var/named/chroot/etc/named.conf_220710
/var/named/chroot/etc/named.conf_230415
/var/named/chroot/etc/named.conf_270810
/var/named/chroot/etc/named.conf_271109



Thanks you so much!
 
I suspect your correct (read *active*) named.conf is /var/named/chroot/etc/named.conf. The other ones in that directory are likely backups when changes were made.

As for the other ones outside of the chroot directory. Who knows what that is. Maybe backups of backups made by the previous admin.

If you're running systemd or init.d you can also probably look into the start up files to verify the correct named.conf.
 
Dear @dcbrown73 that´s right, this is the path /var/named/chroot/etc/named.conf.,
It's init.d, chkconfig will be? How do I know that the current "named" process is executed from /var/named/chroot/etc/named.conf.
 
You need to go look at your init.d script.

I don't have anymore init.d servers, but if I recall correctly. Go look in /etc/init.d/ for a script called named. (or something very similar)

Look inside that file and it should have the start up command which likely include the named.conf file so the binary knows where to look for it's configurations. The named.conf file should include a path that points to the chroot/named/etc/named.conf
 
Hi @dcbrown73 I saw the script file, there's not a specific path with the name "chroot/named/etc" but that's the right path chroot/named/etc/named.conf becasuse the date es the most close to here
 

Attachments

  • status script.txt
    1.9 KB · Views: 357
The script text you provided doesn't appear to be the full script as it only contains the start function.

In that script, it references ${ROOTDIR} which should be a variable referencing the root path to the named.conf. See below.
Code:
    if [ ! -r ${ROOTDIR}${named_conf} ] ; then

The code above is checking to see that named.conf exists, but it is referencing the root path with ${ROOTDIR}. That is likely set higher up in the script, but you did not include that in this snippet.

Go back and look for where ROOTDIR = <whatever> somewhere higher in the script.
 
Hi @dcbrown73 sorry for the delay.

I attach the script named file, I see the next entries that I think is the path
"
if [ -n "$ROOTDIR" ]; then
ROOTDIR=`echo $ROOTDIR | sed 's#//*#/#g;s#/$##'`;
rdl=`/usr/bin/readlink $ROOTDIR`;
if [ -n "$rdl" ]; then
ROOTDIR="$rdl";

Also I checked the named.conf and It's the right file, thanks for you help
 

Attachments

  • init named.txt
    10.4 KB · Views: 332

Members online


Top