Managing Domains and Subdomains in DirectAdmin
Categories: DirectAdmin
Adding, configuring, and organizing many websites under a single account is made simple for users by DirectAdmin, a flexible control panel that streamlines domain and subdomain administration. DirectAdmin offers all the resources you require to establish and maintain your online presence, regardless of whether you are in charge of one website or several domains. We'll go over the necessary procedures for managing domains and subdomains in DirectAdmin in this tutorial.
1. Adding a New Domain
Adding a domain to DirectAdmin is the first step if you want to host multiple websites under one account. Each domain you add will have its own directory and separate configuration, allowing you to manage each site independently.
- To add a new domain:
- Go to Account Manager > Domain Setup.
- Click on Add Another Domain.
- Enter the domain name (e.g.,
yourdomain.com
) and configure options such as Bandwidth and Disk Space limits. - Click Create to finish adding the domain.
DirectAdmin will create a separate directory for your domain in the public_html
folder, where you can upload and manage your website files.
Tip: You can add multiple domains to DirectAdmin if your hosting package allows it. Each domain will be treated as an independent website.
2. Setting Up a Subdomain
A subdomain allows you to create a separate section under your primary domain (e.g., blog.yourdomain.com
). Subdomains are often used for blogs, e-commerce stores, support pages, or staging sites.
- To set up a subdomain:
- Go to Account Manager > Subdomain Management.
- Click on Add Subdomain.
- Enter the subdomain name (e.g., “blog” for
blog.yourdomain.com
) and click Create.
DirectAdmin will create a new directory for your subdomain under the main domain’s folder, where you can upload files specifically for that subdomain.
Tip: Subdomains can help you organize your content by creating unique sections under your primary domain without needing additional domain registrations.
3. Managing DNS Settings for Domains and Subdomains
DirectAdmin allows you to manage DNS settings for each domain and subdomain, giving you control over A records, CNAMEs, MX records, and more. Proper DNS configuration is essential for ensuring your domain is accessible and for setting up email services.
- To access DNS settings:
- Go to Account Manager > DNS Management.
- Select the domain or subdomain you want to edit.
- Add or modify records as needed (e.g., setting an A record to point your domain to a specific IP address or adding MX records for email configuration).
If you’re using third-party services for email or content delivery (e.g., Google Workspace or Cloudflare), updating DNS records is often required to connect these services to your domain.
Tip: Be cautious when editing DNS settings, as incorrect entries can lead to website downtime or email delivery issues.
4. Setting Up Redirects for Domains and Subdomains
DirectAdmin makes it easy to set up redirects, allowing you to forward traffic from one domain or subdomain to another URL. This can be helpful if you want to redirect an old domain to a new one, or if you’re consolidating multiple domains under one main site.
- To set up a redirect:
- Go to Account Manager > Domain Pointers.
- Click Add New Pointer.
- Enter the domain you want to redirect and choose Alias if you want it to point to the main domain directly, or Redirect if you want to specify a custom URL.
This feature is particularly useful for businesses that own multiple domain variations and want to ensure that visitors are directed to their main website.
Tip: Use redirects sparingly to avoid confusing visitors and ensure a seamless user experience across domains.
5. Configuring SSL for Domains and Subdomains
SSL certificates are essential for securing your domains and subdomains, ensuring data privacy and providing HTTPS access. DirectAdmin supports Let’s Encrypt, a free SSL option, and allows for custom SSL certificates from third-party providers.
- To install an SSL certificate:
- Go to Account Manager > SSL Certificates.
- Select the domain or subdomain for which you want to install SSL.
- Choose Free & Auto-Install Let’s Encrypt Certificate for a quick setup, or Paste a pre-generated certificate and key if you’re using a third-party SSL provider.
Enabling SSL ensures secure data transfer and can improve your site’s SEO rankings, as search engines prioritize secure sites.
Tip: Enable auto-renewal for Let’s Encrypt SSL certificates to keep them up to date without manual intervention.
6. Setting Up Email Accounts for Domains
With DirectAdmin, you can create email accounts specific to each domain, which is ideal for businesses that want branded email addresses (e.g., [email protected]). Each domain has its own set of email settings, allowing for separate accounts and storage limits.
- To set up an email account:
- Go to Email Manager > Email Accounts.
- Select the domain, enter the username (e.g., “contact”), and set a password.
- Configure the storage limit, then click Create.
Each email account can be accessed through DirectAdmin’s webmail interface or configured with email clients like Outlook or Gmail.
Tip: Create email aliases or forwarders to streamline communication and direct all domain-related emails to one main account if desired.
7. Creating Domain Aliases
Domain aliases allow you to point multiple domains to the same website without duplicating content. This can be useful if you own different domain extensions (e.g., .com
, .net
, .org
) and want all to lead to the same website.
- To create a domain alias:
- Go to Account Manager > Domain Setup.
- Click on Domain Pointers.
- Enter the alias domain name and select Alias mode to point it to the main domain.
Once set, visitors who enter the alias domain URL will be directed to the primary domain.
Tip: Domain aliases are helpful for protecting brand identity and ensuring that all variations of your domain lead to the same site.
8. Using File Manager to Organize Domain and Subdomain Files
Each domain and subdomain in DirectAdmin has its own directory within the public_html
folder. Proper organization ensures that each site’s files are kept separate and that changes to one site won’t impact others.
- Accessing domain folders:
- Go to System Info & Files > File Manager.
- Navigate to
public_html
, where you’ll see folders for each domain and subdomain. - Upload files to the correct directory to ensure they are accessible at the intended URL.
For example, files for yourdomain.com
will go in the /domains/yourdomain.com/public_html
directory, while files for blog.yourdomain.com
would be placed in /domains/yourdomain.com/public_html/blog
.
Tip: Regularly check file organization to keep your directory structure clear and make updates easier.
9. Monitoring Resource Usage for Each Domain
If you’re managing multiple domains, it’s essential to keep an eye on each one’s resource usage. DirectAdmin provides tools to monitor bandwidth, disk space, and other resources, helping you avoid overages and ensuring smooth performance.
- To monitor resource usage:
- Go to Account Manager > Domain Setup.
- You’ll see a summary of bandwidth and disk space usage for each domain.
Setting individual quotas for each domain ensures that no single site uses up resources intended for multiple sites.
Tip: Regularly review resource usage, especially if your domains experience traffic spikes, to avoid exceeding your hosting plan limits.
10. Troubleshooting Common Domain and Subdomain Issues
Occasionally, you may encounter issues with domains or subdomains, such as DNS errors or SSL problems. DirectAdmin’s tools and logs can help you troubleshoot these issues.
- DNS Issues: Verify DNS records in DNS Management to ensure they are correctly configured. Incorrect DNS settings can lead to site accessibility issues.
- SSL Errors: If you encounter SSL warnings, check that the SSL certificate is correctly installed and not expired. You can re-issue SSL certificates from the SSL Certificates section if necessary.
- File Permissions: If files aren’t loading properly, check the permissions in File Manager to ensure they are set correctly for public access.
Tip: Check DirectAdmin’s error logs if issues persist, as they often provide details on potential causes and solutions.
DirectAdmin’s domain and subdomain management features make it easy to host multiple websites, configure DNS settings, and organize your files effectively. Whether you’re a business with multiple sites, a developer managing staging environments, or simply looking to add a blog subdomain, DirectAdmin’s tools provide the flexibility and control you need. With this guide, you can confidently manage domains and subdomains, ensuring a seamless and organized online presence for all your sites.