Control panels

DirectAdmin: Manage Email Accounts and DNS Records Effectively

Learn how to manage email accounts, set up forwarders, and edit DNS zone records within your DirectAdmin VPS environment.

BeginnerLinux server6 min read

DirectAdmin email accounts and DNS records management is a fundamental task for maintaining a functional and reliable mail service on your Linux VPS. This guide walks you through the necessary steps to create mailboxes, configure email forwarding, and accurately edit your domain's DNS zone records. Proper configuration ensures that your mail is delivered correctly and that your domain resolves properly across the internet.

Before you start

Before attempting to modify mail configurations or DNS records, ensure you have the necessary access and information. You must have root or administrative access to your Linux VPS running DirectAdmin.

Note: Always back up your DNS zone files and critical configuration files before making changes. Incorrect DNS entries can lead to a complete loss of connectivity for your domain.

You will need the following:

  • Administrative access to your DirectAdmin control panel.
  • The domain name you are configuring.
  • The specific DNS records you intend to modify (e.g., A, MX, CNAME, TXT).
  • Knowledge of the specific email account you wish to create or modify.

Creating and Managing Email Accounts

Managing email accounts involves creating new mailboxes, deleting old ones, and ensuring they are configured correctly for sending and receiving mail.

Creating a New Mailbox

  1. Log into your DirectAdmin control panel using your administrative credentials.
  2. Navigate to the Email Accounts section.
  3. Select the domain for which you want to create the mailbox.
  4. Click the option to add a new email account.
  5. Enter the desired username and the full email address format (e.g., user@example.com).
  6. Set a strong password for the new account.
  7. Save the changes. DirectAdmin will now provision the mailbox on the server.

Warning: Never share the password for a mailbox. Compromised credentials can lead to spam or unauthorized access to your server.

Configuring Email Forwarders

Email forwarders are used to automatically redirect incoming mail from one address to another. This is useful if an employee changes their email address but you want their mail to continue arriving in their new inbox.

  1. In the DirectAdmin panel, locate the email account you wish to modify.
  2. Select the option to configure email forwarding.
  3. Enter the original email address (the one receiving mail on the server) and the destination email address (where the mail should be forwarded).
  4. Save the configuration.

Modifying DNS Zone Records

DNS records are the foundational data that tells the internet how to find your domain and its associated services, including email. DirectAdmin allows you to manage these records directly through the control panel, which is generally safer than manual file editing.

Accessing the DNS Zone Editor

  1. In the DirectAdmin interface, navigate to the DNS Zone Editor section.
  2. Select the domain you wish to manage.
  3. You will see a list of all existing records for that domain.

Common Record Types

You must understand the purpose of the most common DNS records when managing mail:

  • A Record: Maps a domain name to an IPv4 address. This is essential for pointing your domain to your VPS IP.
  • MX Record (Mail Exchanger): Specifies the mail servers responsible for accepting email messages on behalf of your domain. This is critical for email delivery.
  • CNAME Record (Canonical Name): Creates an alias from one domain name to another.
  • TXT Record: Used for verification and security purposes, most notably for SPF, DKIM, and DMARC records.

Adding or Editing Records

  1. To add a new record, click the "Add Record" button.
  2. Select the appropriate record type (e.g., MX).
  3. Enter the required fields:
  • Host: The subdomain or domain name this record applies to.
  • Value: The target server or IP address.
  • TTL (Time To Live): How long DNS resolvers should cache the record before checking for updates.
  1. Save the record.

Tip: When adding MX records, ensure you include the priority number specified by your mail provider. This tells receiving servers which mail server to try first.

Check it works

After making changes to email accounts or DNS records, verification is necessary to ensure the changes have propagated and are functioning as intended.

Testing Email Functionality

  1. Account Test: Attempt to send an email from the newly created mailbox to an external address (like a personal Gmail account).
  2. Receiving Test: Send a test email to the newly created mailbox from an external address.
  3. Forwarding Test: If you set up a forwarder, send a test email to the original address and confirm it arrives at the destination inbox.

Testing DNS Propagation

  1. Use online DNS lookup tools (like dig or nslookup from a command line, or external web tools) to query your domain.
  2. Verify that the A record points to the correct IP address of your VPS.
  3. Check the MX records to ensure they point to the correct mail servers.

Troubleshooting

If your email is not arriving or your domain is not resolving, follow these common troubleshooting steps.

  • Symptom: Emails sent to your domain are bouncing back with a "DNS lookup failure" error.
  • Cause: The MX records are incorrect, missing, or have not propagated globally.
  • Fix: Double-check the MX record syntax and priority in DirectAdmin, and use external DNS tools to verify propagation.
  • Symptom: You cannot log into your DirectAdmin panel or access your domain via HTTP.
  • Cause: The A record is pointing to an incorrect IP address, or the firewall is blocking traffic.
  • Fix: Verify the A record in DirectAdmin matches your VPS IP. Review your server's firewall rules.
  • Symptom: A newly created email account is not receiving mail.
  • Cause: The mail server (Postfix/Dovecot) service may not be running, or the account provisioning failed.
  • Fix: Check the server status via the DirectAdmin Dashboard. If issues persist, consult documentation on Postfix and Dovecot mail server setup on a Linux VPS.
  • Symptom: Emails are being marked as spam immediately upon arrival.
  • Cause: Missing security records like SPF, DKIM, or DMARC.
  • Fix: Implement email authentication records. See Set up SPF, DKIM and DMARC in cPanel Email Deliverability for guidance on these critical records.

Next steps

Once you have successfully configured your email accounts and DNS records, you may wish to enhance the security and functionality of your VPS.

To learn more about securing your mail delivery, read about Set up SPF, DKIM and DMARC in CPanel Email Deliverability. If you are looking to manage other aspects of your server, explore DirectAdmin: create a user and a hosting package. For general guidance on server administration, check out Automating MySQL backups with mysqldump and cron.

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.