How-To setup a wildcard DNS record for dynamic subdomains in Plesk 8

This tutorial describes how to setup a wildcard DNS record in Plesk 8 using Bind and Apache. This allows you to use * to access your ( website. For example, any of the following would be automatically redirected to (

Let’s get started!

1. Configure Plesk/Bind DNS

Add a wildcard CNAME record to DNS in Plesk by going to DOMAINS>click the domain you want to configure here>DNS. Add a new record

Record type: CNAME
Enter domain name: *
Enter a canonical name:

So you should have a new record that looks something like this


2. Configure Apache

SSH to your server and edit the vhost.conf file (you may have to create it if you don’t have one for your domain).

# cd /var/www/vhosts/
# touch vhost.conf
# vi vhost.conf
Add this line to the file

ServerAlias *
Save and close the vhost.conf file

Now you must reconfigure the domain via Plesk to pick up the new vhost.conf changes (adds a line to the httpd.include file to look at the directives in the vhost.conf). You can’t edit the httpd.include file directly as it’s overwritten by Plesk all the time. You must make your custom changes to the vhost.conf file.

# /usr/local/psa/admin/sbin/websrvmng –reconfigure-vhost –

Restart the httpd service and thats it.

# /sbin/service httpd restart

Leave a comment