Setting Up Subdomains in DirectAdmin

7 vues DNS & Domains

Creating and Managing Subdomains

Subdomains allow you to create separate sections of your website under your main domain. For example, blog.example.com or shop.example.com. Each subdomain can host different content or even a completely different website.

Creating a Subdomain

  1. Log in to DirectAdmin.
  2. Navigate to Account Manager → Subdomain Management.
  3. Enter the desired subdomain name in the text field (e.g., type blog to create blog.example.com).
  4. Click Create or Add Subdomain.

DirectAdmin will automatically create a directory for the subdomain at /domains/example.com/public_html/blog/. Upload your files to this directory to make them accessible via the subdomain URL.

Subdomain Document Root

By default, subdomain files are stored as a subfolder within your main domain's public_html directory. The typical path structure is:

/home/username/domains/example.com/public_html/blog/

This means files at public_html/blog/index.html will be accessible at both blog.example.com and example.com/blog/.

DNS for Subdomains

DirectAdmin automatically creates the necessary DNS A record for your subdomain when you create it. The subdomain will point to the same IP as your main domain. If your domain uses external DNS (e.g., Cloudflare), you will need to manually add an A record:

Type: A
Name: blog
Value: [your server IP]
TTL: 3600
Wildcard Subdomains: To make all subdomains point to your server, create an A record for * pointing to your server IP. This is useful for applications that dynamically generate subdomains.

SSL for Subdomains

Each subdomain needs its own SSL coverage. When requesting a Let's Encrypt certificate, make sure to include the subdomain in the certificate. Alternatively, request a wildcard certificate (*.example.com) to cover all subdomains automatically.

Deleting a Subdomain

  1. Go to Subdomain Management.
  2. Select the subdomain you wish to remove.
  3. Click Delete.

Note that deleting a subdomain in DirectAdmin removes the DNS record and configuration, but the directory and its files may remain on the server. Remove them manually via the File Manager if needed.

Besoin d'aide ?

Vous ne trouvez pas ce que vous cherchez ? Notre équipe de support est prête à vous aider.

Contacter le support
Bonjour ! Comment pouvons-nous vous aider ?
Discuter