Server Management

Hosting Websites, Email and DNS on One Ubuntu VPS: What You Need to Know

Understand hosting websites, email and DNS on one Ubuntu VPS, including mail records, TLS, deliverability, service dependencies and recovery.

Diagram of website, mail and DNS service paths connected to one Ubuntu VPS

Ubuntu VPS hosting with email and DNS puts several connected services under one operator. A website can load while incoming email fails, and a mailbox can accept a login while its domain is not recognized for delivery. To operate the combination reliably, follow each service path separately and decide which parts belong on the VPS and which remain with your DNS, mail or infrastructure provider.

Follow the website, DNS and email paths separately

A browser resolves a hostname, connects to the published address and requests the website. An incoming mail server looks up the recipient domain's MX record, connects to that mail host and asks whether the recipient exists. An email client authenticates to submission or mailbox services. These are different paths even when one machine handles them all.

Draw a short inventory for each domain: website hostnames, authoritative DNS provider, mail exchanger, submission endpoint and mailbox endpoint. Include external services and any proxy in front of the website. This prevents a common mistake: changing a web record during a site move and accidentally redirecting an unrelated mail service. Treat the inventory as part of the migration and recovery record.

Choose where authoritative DNS lives

A DNS zone in a panel only becomes the public source of answers when the domain's delegation points to that authoritative service. If Cloudflare or another provider remains authoritative, edit the records there. Keeping a local copy can be useful for reference, but two independently edited copies will drift unless an explicit synchronization process exists.

Self-hosted nameservers require correct delegation and, where applicable, glue records at the registrar. Consider DNS availability separately from website availability; two names on the same VPS do not provide independent infrastructure. For many small deployments, external authoritative DNS keeps public resolution available during a VPS outage. Choose the arrangement deliberately rather than assuming every domain must use the panel's DNS server.

Build a mail identity before creating mailboxes

Choose a stable mail hostname, such as mail.example.com, with an address that reaches the mail server. Arrange reverse DNS with the IP provider and check the matching forward record. Confirm the provider permits the mail traffic you need before moving business email. An installed mail package cannot remove a provider's port restriction or repair a poor IP reputation by itself.

In a hosting panel, the domain must be registered for the intended local-mail route and associated with the correct account. Creating a mailbox is not enough if SMTP does not recognize its domain. If email stays remote, preserve that routing and the existing MX records. Test delivery after changing domain or account state, not only after entering the mailbox password.

Understand what each mail DNS record does

MX identifies the receiving mail host; that host also needs usable address records. SPF describes authorized sending infrastructure. DKIM lets receivers validate a message signature using a published public key. DMARC builds policy and reporting around alignment with the visible From domain. These mechanisms complement one another; none is a universal inbox-delivery switch.

Inventory every legitimate sender, including website forms, transactional providers and office mail. Maintain a single coherent SPF policy rather than adding competing SPF records. Publish the correct DKIM selector and verify real messages. Introduce DMARC policy with an understanding of current senders and reports, so a stricter policy does not unexpectedly reject legitimate mail. Recipient providers have their own requirements, which should be reviewed directly.

Record or settingPurposeCommon operational mistake
MX and mail-host A/AAAARoute incoming mail to the receiving serverLeaving MX on an old provider or publishing unreachable IPv6
SPF TXTDescribe permitted sendersAdding a second SPF record instead of updating the existing policy
DKIM TXTPublish the message-signing verification keyUsing the wrong selector or an outdated public key
DMARC TXTDefine alignment policy and reportingEnforcing a policy before identifying legitimate senders
PTR at the IP providerIdentify the sending IP in reverse DNSAssuming a normal DNS-zone edit changes reverse DNS

Keep encryption, authentication and delivery separate

TLS protects a connection when properly negotiated and validated. It does not grant a sender permission to relay messages, prove the recipient exists or replace SPF and DKIM. Mail clients commonly use authenticated submission and IMAP over TLS; configure the actual supported ports, certificate names and connection mode rather than copying a website URL into the mail client.

Verify that your server rejects unauthorized relaying and nonexistent recipients while accepting legitimate local delivery. Do not enable an open relay to fix a delivery problem. Test an external incoming message, confirm it reaches the mailbox and read it through IMAP. Then test authenticated outgoing mail and inspect its authentication results at the destination. A successful TCP connection is only the beginning of that verification.

Account for proxies and provider restrictions

A normal HTTP reverse proxy does not automatically proxy SMTP or IMAP. With Cloudflare's standard web proxy, a dedicated mail-server hostname should use a DNS-only address record unless you have a separately supported transport arrangement. Keep the web hostname and mail hostname roles clear. A website can remain proxied while mail connects directly to its intended endpoint.

For website certificates, HTTP validation must reach the correct challenge path through any proxy, redirect and firewall. DNS validation is another option when an appropriately scoped DNS integration is configured. Neither method should be assumed to work without checking the actual validation result. Certificate issuance for the origin, the browser-facing certificate and mail-service certificates may follow different deployment paths.

Plan for one shared failure domain

When websites, databases and mail share storage and compute, a full disk can affect all three. A growing mail queue, excessive logs or a large backup can consume capacity needed by the database. Monitor disk space, inodes, service behavior and actual customer outcomes. Set retention and quotas with enough room for recovery work.

Keep backup copies outside the VPS and record how to restore each service. Recovering website files does not automatically restore recent messages or DNS authority. Define the acceptable loss window for mail and databases separately. If the workload cannot tolerate shared outages, separate critical services or use suitable external providers. A single-panel interface should not obscure that architecture decision.

What EzePanel manages and what remains external

EzePanel connects domain, DNS, SSL, mailbox and operational workflows through its hosting accounts. Administrators can inspect mail services and queues; account users manage supported mail and website controls within their permissions and package limits. Check the actual job result and public behavior when a change completes.

The VPS provider still controls its network restrictions and reverse-DNS delegation. External DNS changes must reach the authoritative provider, and receiving networks decide how to handle incoming messages. EzePanel cannot guarantee inbox placement or make another provider accept an IP. Use the panel to organize local work and diagnostics, then resolve the dependency identified by the evidence.

Launch and troubleshoot in stages

Start with a disposable domain or a planned transition window. Validate DNS answers, the website route and certificate before moving mail. Preserve old MX details and service access until you have reconciled the transition. When a check fails, identify the failing layer instead of repeatedly recreating mailboxes or toggling unrelated settings.

If mail is rejected before acceptance, inspect the SMTP response and domain/recipient routing. If accepted but absent from the inbox, inspect queue, local delivery and mailbox access. If outgoing mail reaches spam, investigate sender authentication, reputation and recipient policy. This staged approach makes Ubuntu VPS hosting with email and DNS understandable, while keeping changes narrow enough to recover safely.

  • Confirm DNS authority and expected A, AAAA and MX answers.
  • Check provider port policy and forward/reverse mail identity.
  • Publish and validate sender authentication for all legitimate senders.
  • Test incoming delivery, mailbox access and authenticated outgoing mail.
  • Verify invalid-recipient and unauthorized-relay rejection.
  • Document backup scope and the DNS/mail cutover plan.
Actual EzePanel email management screen for account-owned mailboxes
Inside EzePanel. Control placement can vary by installed version.

Sources & further reading

Official documentation for the topics in this guide. Check current vendor requirements before a purchase or server change.