• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issues with BIND on CentOS 7 with Plesk

Status
Not open for further replies.

retro1

New Pleskian
My friend is having issues getting BIND running on CentOS 7 with Plesk 12 and I am offering a hand. You'll have to forgive my rather limited knowledge of setting up DNS servers - it's not my area of expertise and I haven't had to use Linux regularly for some time, so I'm rather rusty.

I have looked at the similar issues on here, but they did not solve the issue.

We have been using the following guide:

http://www.unixmen.com/setting-dns-server-centos-7/

As such, the named.conf is pretty much as you see there, with the following changes:

Code:
allow-query     { localhost; AAA.BBB.CCC.DDD;}; ### IP Range ###
allow-transfer  { localhost; AAA.BBB.CCC.DDD;}; ### Slave DNS IP ###

zone "DOMAIN.com" IN {
type master;
file "forward.DOMAIN";
allow-update { none; };
};
zone "CCC.BBB.AAA.in-addr.arpa" IN {
type master;
file "reverse.DOMAIN";
allow-update { none; };
};

I've masked the actual domain name with DOMAIN (without the .com TLD, so that is noted separately where appropriate) and the IP address is masked as AAA.BBB.CCC.DDD accordingly.

The forward.DOMAIN file is as follows:

Code:
$TTL 86400
@   IN  SOA       ns1.DOMAIN.com. adminemailaddress.hotmail.com. (

        2011071001  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
)
IN NS ns1.DOMAIN.com.
IN NS ns2.DOMAIN.com.
IN A AAA.BBB.CCC.DDD
IN MX 0 DOMAIN.com.
ns1 IN A AAA.BBB.CCC.DDD
ns2 IN A AAA.BBB.CCC.DDD
mail IN CNAME DOMAIN.com.
www IN CNAME DOMAIN.com.

reverse.DOMAIN is very similar to the above. The IN SOA part is identical, but the rest is as follows:

Code:
IN NS ns1.DOMAIN.com.
IN NS ns2.DOMAIN.com.
IN PTR DOMAIN.com.
ns1 IN A AAA.BBB.CCC.DDD
ns2 IN A AAA.BBB.CCC.DDD
IN PTR ns1.DOMAIN.com.
IN PTR ns2.DOMAIN.com.
IN PTR DOMAIN.com.

When it comes to starting named, systemctl enable named works fine. However, it won't start.

systemctl start named
Job for named.service failed. See 'systemctl status named.service' and 'journalctl -xn' for details.

The results are as follows:

systemctl status named.service -l
named.service - Berkeley Internet Name Domain (DNS)
Loaded: loaded (/usr/lib/systemd/system/named.service; enabled)
Active: failed (Result: exit-code) since Mon 2015-01-26 15:42:40 EST; 23s ago
Process: 26059 ExecStartPre=/usr/sbin/named-checkconf -z /etc/named.conf (code=exited, status=1/FAILURE)

Jan 26 15:42:40 DOMAIN.com named-checkconf[26059]: zone CCC.BBB.AAA.in-addr.arpa/IN: not loaded due to errors.
Jan 26 15:42:40 DOMAIN.com named-checkconf[26059]: _default/CCC.BBB.AAA.in-addr.arpa/IN: bad zone
Jan 26 15:42:40 DOMAIN.com named-checkconf[26059]: zone localhost.localdomain/IN: loaded serial 0
Jan 26 15:42:40 DOMAIN.com named-checkconf[26059]: zone localhost/IN: loaded serial 0
Jan 26 15:42:40 DOMAIN.com named-checkconf[26059]: zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0. 0.0.0.0.0.ip6.arpa/IN: loaded serial 0
Jan 26 15:42:40 DOMAIN.com named-checkconf[26059]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
Jan 26 15:42:40 DOMAIN.com named-checkconf[26059]: zone 0.in-addr.arpa/IN: loaded serial 0
Jan 26 15:42:40 DOMAIN.com systemd[1]: named.service: control process exited, code=exited status=1
Jan 26 15:42:40 DOMAIN.com systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
Jan 26 15:42:40 DOMAIN.com systemd[1]: Unit named.service entered failed state.
and
journalctl -xn
-- Logs begin at Mon 2015-01-26 09:38:58 EST, end at Mon 2015-01-26 15:45:50 EST. --
Jan 26 15:45:50 DOMAIN.com named-checkconf[26212]: zone CCC.BBB.AAA.in-addr.arpa/IN: not loaded due to errors.
Jan 26 15:45:50 DOMAIN.com named-checkconf[26212]: _default/CCC.BBB.AAA.in-addr.arpa/IN: bad zone
Jan 26 15:45:50 DOMAIN.com named-checkconf[26212]: zone localhost.localdomain/IN: loaded serial 0
Jan 26 15:45:50 DOMAIN.com named-checkconf[26212]: zone localhost/IN: loaded serial 0
Jan 26 15:45:50 DOMAIN.com named-checkconf[26212]: zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip
Jan 26 15:45:50 DOMAIN.com named-checkconf[26212]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
Jan 26 15:45:50 DOMAIN.com named-checkconf[26212]: zone 0.in-addr.arpa/IN: loaded serial 0
Jan 26 15:45:50 DOMAIN.com systemd[1]: named.service: control process exited, code=exited status=1
Jan 26 15:45:50 DOMAIN.com systemd[1]: Failed to start Berkeley Internet Name Domain (DNS).
-- Subject: Unit named.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit named.service has failed.
--
-- The result is failed.
Jan 26 15:45:50 DOMAIN.com systemd[1]: Unit named.service entered failed state.
lines 1-18/18 (END)

named-checkconf /etc/named.conf gives back nothing (I believe that's good). However, named-checkzone produces an error (the same on forward and reverse files):

named-checkzone DOMAIN.com /var/named/forward.DOMAIN
zone DOMAIN.com/IN: has no NS records
zone DOMAIN.com/IN: not loaded due to errors.

I did notice that this post mentioned chroot (we tried using named-chroot too, with errors) and to copy the code from /var/named/chroot/var/named/chroot/etc/named.conf.default to the empty named.conf.

Well, this file didn't exist, but there was one at /var/named/chroot/etc/named.conf.default - following the above instructions and stopping named, I could then use:

systemctl start named-chroot

This didn't produce any errors! Yay! named-checkconf confirms the same.

I now get this:

systemctl status named-chroot
named-chroot.service - Berkeley Internet Name Domain (DNS)
Loaded: loaded (/usr/lib/systemd/system/named-chroot.service; enabled)
Active: active (running) since Mon 2015-01-26 16:12:47 EST; 37s ago
Process: 27510 ExecStart=/usr/sbin/named -u named -t /var/named/chroot $OPTIONS (code=exited, status=0/SUCCESS)
Process: 27507 ExecStartPre=/usr/sbin/named-checkconf -t /var/named/chroot -z /etc/named.conf (code=exited, status=0/SUCCESS)
Main PID: 27511 (named)
CGroup: /system.slice/named-chroot.service
└─27511 /usr/sbin/named -u named -t /var/named/chroot -c /etc/named.conf -u named -n 2

Jan 26 16:12:47 DOMAIN.com named[27511]: automatic empty zone: 9.E.F.IP6.ARPA
Jan 26 16:12:47 DOMAIN.com named[27511]: automatic empty zone: A.E.F.IP6.ARPA
Jan 26 16:12:47 DOMAIN.com named[27511]: automatic empty zone: B.E.F.IP6.ARPA
Jan 26 16:12:47 DOMAIN.com named[27511]: automatic empty zone: 8.B.D.0.1.0.0.2.IP6.ARPA
Jan 26 16:12:47 DOMAIN.com named[27511]: command channel listening on 127.0.0.1#953
Jan 26 16:12:47 DOMAIN.com named[27511]: managed-keys-zone: loaded serial 0
Jan 26 16:12:47 DOMAIN.com named[27511]: zone 0.0.127.IN-ADDR.ARPA/IN: loaded serial 20010622
Jan 26 16:12:47 DOMAIN.com named[27511]: all zones loaded
Jan 26 16:12:47 DOMAIN.com named[27511]: running
Jan 26 16:12:47 DOMAIN.com systemd[1]: Started Berkeley Internet Name Domain (DNS).

However, named-checkzone still gives the same error as before, regardless of which location I use for the zone files. I assume this is because it is related to named, not named-chroot?

The named.conf.default that I copied over was quite different - it had stuff about how Plesk was going to overwrite any information I changed, although there was a section where I could add custom directives. I tried copying the contents of my named.conf in there... and it broke it! named-chroot would no longer start, giving errors.

So... can anyone advise me where to go from here?

Incidentally, I don't have access to the Plesk panel right now - my friend left me the login credentials, they were wrong and I locked myself out! He told me that the Plesk panel sees the server root as 127.0.0.1. He also told me BIND wouldn't start via Plesk. I am logging in as root via SSH. He also tried reinstalling BIND, but it hasn't got us any further.

Any assistance would be greatly appreciated.
 
We've actually opted for a complete reinstall of the server as something appears to be messed up. This can be deleted. Thanks!
 
Status
Not open for further replies.
Back
Top