How to use MyDNS-NG



We deprecated the MyDNS and NSD nameservers in cPanel & WHM version 78 and plan to remove them a future release. We strongly recommend that you migrate to PowerDNS. For more information, read our cPanel Deprecation Plan.

MyDNS-NG (MyDNS) is DNS server software for Linux servers. MyDNS uses a database to store the server’s DNS zone files, which allows it to efficiently manage large numbers (hundreds of thousands) of zone records.

MyDNS requires the following minimum configuration to run on your cPanel & WHM server:

  • cPanel & WHM version 11.32 or later.
  • MySQL® version 5.0 or later.
  • BIND
  • MyDNS does not remove BIND from the system. cPanel & WHM requires the BIND service.
  • MyDNS does not support Domain Name System Security Extensions (DNSSEC) or PostgreSQL®.

Install MyDNS


Currently, you cannot install MyDNS during the cPanel & WHM installation process.

To install MyDNS through the WHM interface, perform the following steps:

  1. Navigate to WHM’s Nameserver Selection interface (WHM >> Home >> Service Configuration >> Nameserver Selection).
  2. Select MyDNS.
  3. Click Save.

To install MyDNS through the command line, run the following command as the root user:

/usr/local/cpanel/scripts/setupnameserver mydns

Return to MyDNS from another DNS server


If you change to a different DNS server and then change back to MyDNS, you must run a forced DNS import and restart MyDNS.

To perform the import and restart MyDNS, perform the following steps:

  1. Run the following command as the root user to force a DNS import:

    • This script will clear the rr database table, which will cause DNS lookup errors until your server refreshes that table.
    • You will receive a confirmation email when this command finishes. Do not proceed until you receive that email.
  2. Run the following command as the root user to restart MyDNS:


MyDNS on your server

The system installs MyDNS to the /usr/local/cpanel/3rdparty/ directory. After installation, the system syncs the zone files in the /var/named/ directory with the records in the MyDNS database.

Each server that uses MyDNS includes its own MySQL database for MyDNS. The server’s database name corresponds to the mydns_hostname format, where hostname represents the server’s hostname.

MyDNS on remote MySQL servers

cPanel & WHM’s implementation of MyDNS can function with a remote MySQL server.

  • To set up the connection to the remote MySQL server, navigate to WHM’s Manage MySQL® Profiles interface (WHM >> Home >> SQL Services >> Manage MySQL Profiles).
  • When you run MyDNS on a dedicated MySQL server, each connected server maintains its own unique database of zone files. The MySQL server retrieves these zone files from the servers and does not retain a central copy of them.

Troubleshoot MyDNS

Because MyDNS uses a MySQL database to store zone files, any problem with MySQL will affect MyDNS’s performance. If you experience problems with MyDNS, first make certain that MySQL responds.

To confirm that MySQL responds to WHM, perform one of the following actions:

  • Navigate to WHM’s Show MySQL Processes interface (WHM >> Home >> SQL Services >> Show MySQL Processes). If MySQL responds, the system will display the SHOW PROCESSLIST query.
  • Run the following command as the root user:
    netstat -tap | grep mysql

If MySQL responds, the system will return information that resembles the following example:

tcp        0      0 *:mysql                     :                         LISTEN      17280/mysqld

To troubleshoot MyDNS further, check the following error logs:

  • /usr/local/cpanel/logs/error_log — The WHM error log.
  • /var/log/messages — The MyDNS error log.
  • /usr/local/cpanel/logs/dnsadmin_log — The dnsadmin error log. WHM’s dnsadmin service interacts with DNS zone files.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also