Articles in this section

Cannot start BIND or run plesk repair dns on Plesk server: has no address records

Plesk for Linux kb: technical ABT: Group B

Applicable to:

  • Plesk for Linux

Symptoms

  • Cannot start BIND DNS server or to run plesk repair dns command:

    # systemctl status named-chroot
    ● named-chroot.service - Berkeley Internet Name Domain (DNS)
    Loaded: loaded (/usr/lib/systemd/system/named-chroot.service; enabled; vendor preset: disabled)
    Active: failed (Result: exit-code) since Tue 2019-01-08 02:10:22 GMT; 7s ago
    ...

    # plesk repair dns -y
    ...
    PHP Fatal error: Uncaught exception 'PleskMultipleException' with message 'Error during example.com updateZone: dnsmng failed: dnsmng: Unable to update reverse lookup zone
    ...

  • In /var/log/messages the following errors might be shown:

    CONFIG_TEXT: named-checkconf: zone example.com/IN: NS 'ns1.example.com' has no address records (A or AAAA)
    named-checkconf: zone example.com/IN: example.com/MX 'mail.example.com' has no address records (A or AAAA) \


    CONFIG_TEXT: named: zone example.com/IN: has no NS records
    named: zone 312.kg/IN: not loaded due to errors.
    _default/example.com/IN: bad zone


    CONFIG_TEXT: dnsmng[121377]: Failed to update reverse lookup DNS zone for domain 'example.com': bad lexical cast: source type value could not be interpreted as target
    named[48070]: zone example.com/IN: zone serial (2015011702) unchanged. zone may fail to transfer to slaves.

  • Domain example.com does not exist in Plesk.

Cause

Inconsistency in Plesk database with invalid DNS zones from inexistent domains causes problems in DNS service.

Resolution

  1. Connect to the server via SSH

  2. Back up Plesk database:

    # plesk db dump psa > psa.backup.sql

  3. Remove orphaned records:

    # plesk db "delete from dns_zone where id not in (select dns_zone_id from domains) and id not in (select dns_zone_id from domain_aliases) and id not in (select val from misc where param = 'default_dns_zone_id')"

    # plesk db "delete from dns_recs where dns_zone_id not in (select dns_zone_id from domains) and dns_zone_id not in (select dns_zone_id from domain_aliases) and dns_zone_id not in (select val from misc where param = 'default_dns_zone_id')"

  4. Backup /etc/named.conf file:

    # cp -a /etc/named.conf{,.backup}

  5. Remove all configuration related to example.com from /etc/named.conf file. The configuration that needs to be removed looks like follows:

    CONFIG_TEXT: zone "example.com" {
    type master;
    file "example.com";
    allow-transfer {
    203.0.113.2;
    common-allow-transfer;
    };
    };

  6. Move example.com DNS zone from /var/named/chroot/var directory:

    # mv /var/named/chroot/var/example.com /root/example.com

  7. Restart bind:

    # service named-chroot restart

  8. Repair DNS zones:

    # plesk repair dns -y

Was this article helpful?

Comments

1 comment
Date Votes
  • Hi Leonid Gukhman,

     

    May I ask, if it could it be, on step (6) the directory is different than stated?

    And if so, is it:

    /var/named/run-root/var

     

    And is step (7):

    systemctl restart named.service 
    0

Please sign in to leave a comment.