How to configure DNS for custom domain publishing

If you want to allow your end-users to publish their site(s) using their own domain names, like, you will need to complete the following steps:

  1. Configure local DNS on the server hosting your copy of Pagestead. You will need to instruct your server to direct requests for the custom domain to the folder on the server containing your Pagestead code
  2. Create a DNS record for the custom domain which points to your Pagestead server. This needs to be completed at the main nameserver for the custom domain (typically, this is a step your end-users will need to complete themselves, as it requires access to the domain’s DNS records).

1. Configure local DNS on Pagestead server

If you’re looking to offer custom domain publishing to your end-users, we advice to use a server or VPS without cPanel. When using cPanel, it’s not possible to implement a single solution which would cover all custom domains used by your users. Instead, you would need to add every single individual custom domain manually to your cPanel.

Using a server or VPS without cPanel allows for a single configuration, which only needs to be applied once. This solution would then work for each and every custom domain connected to your Pagestead application by your end-users.

Bellow we are describe the process for Debian based (Debian, Ubuntu etc.) Linux distributions and RedHat based (RedHat, CentOS etc.) Linux distributions:

a. Debian based (Debian, Ubuntu )

  1. Create a file named ‘custom.conf’ in /etc/apache2/sites-available/custom.conf and add the following content:

    <VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

  2. Now activate the new configuration file with the following command:

    sudo a2ensite /etc/apache2/sites-available/custom.conf

b. RedHat based (RedHat, CentOS)

Create the following directories if they don’t currently exist:

sudo mkdir /etc/httpd/sites-available
sudo mkdir /etc/httpd/sites-enabled

Next, we should tell Apache to look for virtual hosts in the sites-enabled directory, edit the Apache configuration file with following command:

sudo nano /etc/httpd/conf/httpd.conf

Add the following line to the end of the file:

IncludeOptional sites-enabled/*.conf

Save and close (Ctrl + X) the file when you are done. We are now ready to create our virtual host file.

Create new virtual host file with the following command:

sudo nano /etc/httpd/sites-available/custom.conf

Finally, we’ll finish up by pointing to the root directory of our SBPro installation directory (we assure its /var/www ). We will also tell Apache where to store error and request logs for this particular site:

<VirtualHost *:80>
DocumentRoot /var/www
ErrorLog /var/www/error.log
CustomLog /var/www/requests.log combined

When you are finished writing out these items, you can save and close the file.

Now enable that virtual host with following command,

sudo ln -s /etc/httpd/sites-available/custom.conf /etc/httpd/sites-enabled/custom.conf
When you are finished, restart Apache to make these changes take effect by following command,

sudo apachectl restart

c. cPanel based hosting

As explained before, using cPanel in combination with custom domain publishing means you will need to maunally add each and every custom domain used by your end-users. You can do so by the following these steps:

  1. Login to your cPanel
  2. Go to “Aliases” from “Domains” section.
  3. Add the custom domain name and click the button labeled “Add Domain”.

2. Create DNS record for custom domain

Note: this step needs to be completed by the end-user, as it requires access the custom domain’s DNS records.

Using cPanel

Login to your cPanel and Click over Zone Editor and Add an A Record with Name * and address as your Server IP.

Using the domain registrar’s DNS

Log into your account with your domain registrar (the organization from which you purchased the domain) and locate the DNS administration area. Create a new DNS “A” record, set its value to “” (keep it blank) and point the new record to the IP address of your Pagestead server. If you do not know what the IP address of your Pagestead server is, you can use a tool like this one to figure out the correct IP address.

Was this article helpful?

Related Articles


  1. Step 2 tells the user to point their A records to the server IP. However in the software it tells the user to point the A records to the website address ( Also, when trying to publish a custom domain, it asks for ftp details (even if turned off in the package). This isn’t mentioned in this article.

  2. Hi Ben,
    I can understand how that might be confusing. However, a DNS A record must be pointed to an IP address (it can not be pointed to a domain name).

    We will be setting up a new support portal, including an updated knowledge base soon. During the move, we will be giving some much needed love and attention the knowledge base and patch it up where needed.

  3. Niklas

    Im running cpanel on my server. Is it not easier to let the user point the custom domain to our nameservers instead of creating an A-record? If the also use our nameservers the automatically got SSL-certification.

    Is this possible? And maybe easier than your suggestion above?… If the customer use our nameservers, what should I do next to connect the users website etc.

  4. Hello! I can’t do this. I’m not an expert linux user and I’m stuck at this step for months. I think there’s a problem with permissions.
    Dear system administrator, I would like to give you my server information if you don’t mind. so you can help me very quickly.
    good work.

Leave A Comment?

You must be logged in to post a comment.