How do i map a subdomain (Wordpress/Ubuntu) to it's own registered domain

Posted March 14, 2015 8.5k views

Hi, installed wordpress using the 1 click set up on Ubuntu 14.04. I created my main wordpress site, then i enabled multisite and created a second subdomain site.

I assigned my ip address to my first site and pointed it’s registered domain to the digital oceans name server.

How do i map the subdomain site to another registered domain, so instead of the address being “” it has it’s own unique address even though they both have the same ip address.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

You need to create DNS A records for each subdomain you wish to use and point them to the IP address of your server. Alternatively, you can create a single “wildcard” entry. Check out this tutorial for more information on setting up WordPress Multisite. It doesn’t use the One-Click app as a base, but it should point you in the right direction.

by Jesin A
This tutorial will show you how to set up WordPress Multisite with subdomains on an Nginx web server. This allows you to run multiple unrelated websites, with their own domains, from a single WordPress admin panel.
  • Thanks for the reply, do i create multiple A records for each subdomain under the same domain, or do i create a new domain for each site and create an A record for each them ?

    if the first then what about cname?

  • @rami1, one A record for each subdomain under the same domain.

    This tutorial explains the different DNS records well:

    A Records: Use this space to enter in the IP address of the droplet that you want to host your domain name on and the host name itself, a name prepended to your domain name.

    CNAME Records: The CNAME record works as an alias of the A Record, pointing a subdomain to an A record— if an A Record’s IP address changes, the CNAME will follow to the new address.

    Basically, an A record points to an IP address, while a CNAME record points to another record.

    In your case, you can either create an A record pointing to your droplet’s IP address for each subdomain, or create an A record for the droplet itself (e.g. and then create a CNAME record for each domain pointing to the “droplet1” A record.

    Either way works fine.

  • @kamaln7 , Thanks for your help. Ive since tried to set up multiple sites using the following tutorials:

    • How To Set Up Apache Virtual Hosts on Ubuntu 14.04 LTS
    • How To Install Wordpress on Ubuntu 14.04

    Everything seems to be set up correctly i have the 1st WP site working, but i can’t get the second to work at the moment.

    Is this the same answer when setting multiple VPS, i.e. one A record for each website under the same domain.

    I’m trying to pinpoint the issue, the second website says “Error establishing a database connection”