Articles in this section

Bind9 service is running on a Plesk server but does not serve DNS queries

Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

  • Websites hosted on a Plesk server can not be accessed in a web browser

  • Domains are not resolved locally from the server:

    # dig +short example.com @localhost

  • Bind9 service is running:

    # systemctl status bind9
    ● named.service - BIND Domain Name Server
    Loaded: loaded (/lib/systemd/system/named.service; enabled; vendor preset: enabled)
    Active: active (running) since Thu 2022-04-07 11:15:05 UTC; 2h 52min ago
    Docs: man:named(8)
    Process: 8835 ExecReload=/usr/sbin/rndc reload (code=exited, status=1/FAILURE)
    ...
    CGroup: /system.slice/named.service
    └─68392 /usr/sbin/named -f -u bind


    Bind9 service is in activating status:

    # service named status
    * named.service - BIND Domain Name Server
    Loaded: loaded (/lib/systemd/system/named.service; enabled; vendor preset: enabled)
    Drop-In: /lib/systemd/system/bind9.service.d
    `-respawn.conf
    Active: activating (auto-restart) (Result: exit-code) since Tue 2023-01-10 22:02:48 CST; 3s ago

  • Running the following command from the server contains below output:

    # dig +trace
    (...)
    ;; BAD (HORIZONTAL) REFERRAL
    dig: too many lookups
    (...)

Cause

Incorrect options for ExecStart and EnvironmentFile in service configuration file /lib/systemd/system/named.service.

Resolution

  1. Login to the server via SSH.

  2. Create a backup of /lib/systemd/system/named.service

    # cp -p /lib/systemd/system/named.service /root/

  3. Replace all content inside /lib/systemd/system/named.service with below:

    [Unit]
    Description=BIND Domain Name Server
    Documentation=man:named(8)
    After=network.target
    Wants=nss-lookup.target
    Before=nss-lookup.target
    [Service]
    Type=forking
    EnvironmentFile=-/etc/default/bind9
    ExecStart=/usr/sbin/named $OPTIONS
    ExecReload=/usr/sbin/rndc reload
    ExecStop=/usr/sbin/rndc stop
    [Install]
    WantedBy=multi-user.target

  4. Restart bind9:

    • For Plesk on RHEL based operating systems:

      # systemctl daemon-reload
      # systemctl restart named-chrooted.service

    • For Plesk on Debian based operating systems:

      # systemctl daemon-reload
      # systemctl restart bind9.service

  5. Repair Plesk DNS:

    # plesk repair dns -y

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.