# Using a subdomain as an account's primary domain

> Create a cPanel account in WHM that uses a subdomain as its primary domain, for example before a domain is registered.

Source: https://helpcenter.ruachost.com/vps/whm/using-a-subdomain-as-an-accounts-primary-domain/

In some cases, you may want to create a hosting account that uses a **subdomain** instead of a full domain name. This is useful when a client has not yet purchased a domain but still wants to start building their website.

## Why Use a Subdomain as the Primary Domain?

- Allows clients to begin development before registering a domain.
- Provides temporary access to a site under another domain.
- Useful for testing, staging, or demo environments.
- Simplifies onboarding for new customers.

## Steps to Set Up a Subdomain as the Primary Domain

### 1. Create the Account

1. **Log in to WHM.**
2. Go to **Account Functions → Create a New Account**.
3. In the **Domain** field, enter the subdomain you want to use.

   - Example: `testing.example.com`
4. Fill in the rest of the account details (username, password, package, etc.). ???? The account will be created with the subdomain as its primary domain.

### 2. Edit the DNS Zone

After creating the account, you must update the DNS zone of the parent domain:

1. In WHM, search for **DNS Zone Manager**.
2. Select the **primary domain** (e.g., `example.com`).
3. Click **Manage**.
4. Add a new **A record** for the subdomain:

   - **Valid zone name** → `testing.example.com`
   - **TTL** → Leave default (e.g., 14400).
   - **Type** → `A`
   - **IPv4 Address** → Enter the IP address of the new account.
5. Click **Save Record**. Once DNS propagation completes, the subdomain will point to the new account.

> **Note:**
- DNS propagation may take several hours.
- The subdomain must be added to the parent domain’s DNS zone.
- This setup is temporary; once the client purchases a domain, you can migrate the site to its own primary domain.
