Configure a domain in cPanel
What does configuring a domain in cPanel mean?
Configuring a domain in cPanel allows you to associate a domain name with your hosting, create subdomains, manage DNS, and configure the directory where your website files will be hosted. It's one of the fundamental steps to get your website online.
Steps to configure a domain
1. Access cPanel
- Go to your cPanel panel
- Log in with your credentials
2. Go to "Domains" section
On the cPanel main page, look for the "Domains" section and click on "Domains".
You can also search for it using the search box at the top of cPanel.
3. Add a domain
In the "Create a New Domain" section:
- Enter the domain name (for example:
yourdomain.com) - The subdirectory will be created automatically, but you can change it if you want
- Click "Submit"
Note: The domain will be added as an "addon domain". The main domain of your account generally cannot be changed.
4. Configure domain directory
By default, cPanel will create a directory in public_html/yourdomain.com for the domain files.
If you want to use a different directory:
- Specify the path in the "Document Root" field
- You can use a custom folder like
public_html/mysite
Important: Make sure the directory has correct permissions (usually 755 for directories and 644 for files).
5. Configure domain DNS
For the domain to work correctly, you need to configure DNS records:
Option A: Use your hosting's nameservers
- In your domain registrar, change nameservers to those provided by your hosting
- Usually something like:
ns1.yourhosting.comandns2.yourhosting.com
Option B: Configure DNS records manually
- In cPanel, search for "Zone Editor"
- Select your domain
- Add or modify necessary DNS records:
- A Record: Points the domain to the server IP
- CNAME Record: For subdomains like
www - MX Record: For email
6. Verify configuration
After adding the domain, verify:
- That the domain appears in the "Addon Domains" list
- That the directory was created correctly
- That you can access the directory from "File Manager"
Upload files to domain
Once the domain is configured, you can upload your files:
- In cPanel, search for "File Manager"
- Navigate to the domain directory (usually
public_html/yourdomain.com) - Upload your files using the "Upload" button
- Or use FTP/SFTP to transfer files
Create subdomains
To create a subdomain (for example: blog.yourdomain.com):
- In cPanel, search for "Subdomains"
- Enter the subdomain name (without the main domain)
- Select the main domain
- Choose the directory where files will be hosted
- Click "Create"
Configure redirects
If you want to redirect one domain to another:
- In cPanel, search for "Redirects"
- Select the redirect type (temporary 302 or permanent 301)
- Enter the source domain or URL
- Enter the destination domain or URL
- Click "Add"
Delete a domain
If you need to delete an addon domain:
- In the "Addon Domains" section, find the domain
- Click "Remove"
- Confirm deletion
Warning: Deleting a domain does not delete the directory files. If you want to delete the files too, do it manually from File Manager.
Common problems
Domain doesn't load
- Verify nameservers are configured correctly
- Wait for DNS propagation (can take up to 48 hours)
- Verify DNS records are correct
- Verify the domain is pointing to the correct IP
Error 404 or "Site not found"
- Verify files are in the correct directory
- Verify an
index.htmlorindex.phpfile exists - Verify file and directory permissions
Domain shows main domain's site
- Verify the domain is configured as an addon domain, not an alias
- Verify the domain directory is correct
- Check Apache configuration in cPanel
Advanced configuration
Use .htaccess for custom configuration
You can create a .htaccess file in the domain directory to:
- Configure rewrite rules
- Protect directories with password
- Configure custom error pages
- Force HTTPS
Example .htaccess to force HTTPS:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Tips
- Use descriptive domain names: Choose names that represent your site
- Configure DNS correctly: Make sure DNS records are properly configured
- Make backups: Before making important changes, make a backup
- Verify propagation: Use tools like whatsmydns.net to verify DNS propagation
- Document configuration: Keep a record of how you configured each domain
Need help?
If you're having trouble configuring your domain in cPanel, open a ticket from the billing.baires.host panel or contact us for support.
You can also reach us through our social media:
- Instagram: @baires_host
- Discord (active support): https://discord.gg/dzjauatAFN
- Linktree: https://linktr.ee/baires.host