DNS

Plesk for Linux works in cooperation with the BIND (or named) domain name server that enables you to run a DNS service on the same machine on which you host websites.

When you add a domain name to Plesk, it automatically generates a zone file for this domain in accordance with the server-wide DNS zone template and registers it in the name server's database, then instructs the name server to act as a primary (master) DNS server for the zone.

Configuring DNS

You can change the name server settings by editing configuration file /var/named/run-root/etc/named.conf (/etc/named.conf is a soft link to it). This file consists of the following parts:

General Settings containing the following sections:

The Options section contains the directory option referring to /var, which is used as the base directory relative to $ROOTDIR (which is /var/named/run-root by default) for all other files used below. It also sets the location where named will store its PID.

The key and control sections define a shared key for managing named with the rndc utility and access list.

The final part containing the acl section, which defines an access control list of name server IP addresses where zone transfers are allowed. By default, the common-allow-transfer ACL is included in every zone section.

Note: If you perform change zone entries in the file manually, Plesk will override them with changes made through the GUI.

Zone files

By default, zone files for domains are stored in the /var/named/run-root/var directory, as defined in the /var/named/run-root/etc/named.conf file. Each zone file has a name identical to the domain name. If you change the zone through the GUI, Plesk rewrites the file.

You can change a zone database by adding or deleting resource records as follows:

Access Control Lists

You can restrict the name server to transferring name zones to only the list of explicitly assigned DNS servers. Do this by inserting the DNS server IP addresses into the misc table of the psa database with the following command:

mysql> insert into misc (param, val) values ('DNS_Allow_Transfer1', <dns server>);

for the first DNS server in the list.

mysql> insert into misc (param, val) values ('DNS_Allow_Transfer2', <dns server>);

for the second DNS server, etc.

To transfer the changes made in the database to the DNS configuration file, use the following command:

# /usr/local/psa/admin/sbin/dnsmng update <domain_name>

The command shown above adds DNS server IP addresses to the common-allow-transfer ACL, which is included in all local name zones. Every domain can have some additional IP addresses in its ACL. Secondary servers are added to the allow-transfer list of a domain by Plesk after adding the corresponding NS records to the domain name zone. In addition, the secondary server must be resolvable and accessible when it is added to the name zone.

DNS logs

The domain name service writes errors log stored in the /var/log/plesk/messages file. The logrotate utility rotates this log on a daily, weekly, or monthly basis. Learn how to configure log rotation in the section Log Rotation.