DNS & TLS
Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn.
DNS and TLS are two halves of one job: get a domain served safely by this server.
The A record has to point correctly → validation can reach the host → the
certificate issues → HTTPS works. MZPanel keeps both on one DNS & TLS section
per server (/servers/:id/dns-tls), so the most common support problem — “SSL
won’t issue / the site won’t load,” almost always a DNS mistake — is visible in
one place. Certificate issuing works on all plans; writing DNS records needs a
connected Cloudflare token (also on all plans), and running your own nameservers needs the
BIND9 extension (Pro).
The section has two tabs in its toolbar: DNS & TLS (the per-domain view, default) and zoneDNS (authoritative BIND9 zones on this box).
Issue or renew a certificate, step by step
Section titled “Issue or renew a certificate, step by step”- On the DNS & TLS tab, find the domain’s row and click Manage to open its drawer. It opens on the Certificate tab.
- Read the recommended strategy banner at the top — it’s derived from the domain’s live DNS. DNS-only → Let’s Encrypt (HTTP-01); proxied through Cloudflare → a Cloudflare Origin Certificate; not pointing here yet → “point the A record here first.”
- If there’s no certificate yet, click Issue certificate. If one exists, use Renew now (Let’s Encrypt) or Re-issue (auto) (self-signed / Origin) — the button auto-detects the right method from the domain’s DNS.
- For Let’s Encrypt certificates, toggle Enable / Disable auto-renew. The row updates in place with the new status, issuer and expiry.
What else you can do
Section titled “What else you can do”- Scan the fleet at a glance. Each row pairs a live DNS verdict (Proxied via Cloudflare, Direct to IP — exposed, Points elsewhere, or No A record) with a SSL/TLS status (Valid, Expiring, Expired, No cert), the certificate’s days remaining and auto-renew state.
- Filter by All domains, On Cloudflare (proxied), IP exposed (direct), Misconfigured DNS, or SSL needs attention — and search by domain name.
- Force HTTPS — the per-row HTTPS toggle turns on the HTTP → HTTPS redirect in the site’s vhost (available once a certificate exists).
- Toggle the Cloudflare proxy — the per-row Proxy switch flips a domain between proxied (orange cloud, IP hidden) and DNS-only (grey), when a Cloudflare token owns the zone.
- Bulk actions — select multiple domains and the floating dock offers Renew SSL and a Proxy & HTTPS popover that pushes proxy-on/off and force-HTTPS on/off to every selected domain.
- Edit DNS records — the DNS records tab of the Manage drawer shows the
live
digresolution, and, when Cloudflare is connected, a full record editor (add/edit/delete A/AAAA/CNAME/MX/TXT/SRV/CAA/NS and more, proxy toggle, TTL, and a one-click Point here). - Install a custom or paid certificate — the Advanced panel on the Certificate tab offers a Cloudflare Origin Certificate, Upload a certificate (paste your own cert + key), or Buy a certificate (generate a CSR on the box, buy from any CA, paste the signed cert back — the private key never leaves the server).
- Run your own nameservers — the zoneDNS tab manages authoritative BIND9 zones (see below).
Cloudflare only
Section titled “Cloudflare only”When a domain is proxied through Cloudflare (orange cloud), its server IP can still be hit directly, skipping Cloudflare’s WAF, cache and rate limits. Cloudflare only makes nginx close (no response, code 444) every request to that site that does not come from a Cloudflare edge. Requests from the server itself (127.0.0.1) are always allowed, so health checks and the agent’s own calls keep working.
- A site, app or stack created while its domain already resolves to Cloudflare gets this automatically. Use the switch to turn it on later, or off.
- Site: open the site, Security → Firewall, card Cloudflare only, switch Only accept traffic through Cloudflare.
- Docker app: the app’s Domains section, same card. It covers every domain of the app.
- Turning it on is refused when the domain does not resolve to Cloudflare right now
(
not_proxied): turn the orange cloud on in Cloudflare first, wait for DNS, then retry. - The setting survives certificate issuing, redeploys and domain changes.
- Needs agent 0.2.159 or newer; older agents show an “update the agent” hint.
The server keeps Cloudflare’s IP ranges in a local list that refreshes daily from system cron (it keeps working while MZPanel is unreachable). A failed download or a broken list never replaces the current one.
How it works
Section titled “How it works”The DNS & TLS tab joins three data sources per domain:
| Signal | Where it comes from |
|---|---|
| Domain list | the agent-pushed sites inventory (instant, works offline) |
| Certificate status | the agent-pushed ssl inventory (issuer, expiry, days left, auto-renew, HTTPS redirect) |
| Live DNS health | a dns.lookup job per domain — the agent shells to dig and reports A/AAAA/CNAME/MX/TXT/NS, whether it resolves to this server, and whether Cloudflare is proxying |
Certificate actions dispatch ssl.* jobs to the agent, which runs them natively:
| Action | Job | Agent runs |
|---|---|---|
| Issue | ssl.issue | ssl issue <domain> (Let’s Encrypt / origin / self-signed, auto-picked) |
| Renew / re-issue | ssl.renew | ssl renew <domain> |
| Delete | ssl.delete | removes the certificate, site falls back to HTTP |
| Auto-renew on/off | ssl.auto-renew | toggles the certbot renewal for that domain |
| Force HTTPS | ssl.https-redirect | adds/removes the return 301 HTTPS redirect in the vhost |
Cloudflare record editing is different — it runs on the control plane, not the
agent. MZPanel needs a scoped Cloudflare API token, connected once at the account
level; it’s verified against the Cloudflare API and stored encrypted on the
control plane and never sent to your VPS. Record CRUD, the proxy toggle,
Origin Certificates and CSR/paste flows all go control plane → Cloudflare API (or
control plane → agent for installing the finished cert). dig alone is read-only
(“what the world sees”), which is why writes need the token.
The zoneDNS tab drives dns.* jobs against BIND9 running on the box: dns.status
(is BIND9 installed, which nameservers), dns.ns-set (set your nameserver
hostnames), dns.zone-list / zone-create / zone-delete, dns.record-list /
record-add / record-del, dns.reload, and dns.sync (scan site domains and
auto-create zones for any now delegated here). Zone state is served from the
agent-pushed dns inventory snapshot, so the list loads instantly; every zone is
validated with named-checkzone before a reload, so a broken zone never loads.
CLI & automation
Section titled “CLI & automation”Every box-native action here maps to an mz command — the same engine the
dashboard drives. SSH into the server and run them directly:
mz dns example.com --json # live dig health for a domainmz ssl issue example.com --json # issue a certificatemz ssl renew example.com --json # renew / re-issuemz ssl auto-renew example.com on --json # toggle Let's Encrypt auto-renewmz site cf-only example.com --on --json # Cloudflare only: on | --off | no flag = statusmz app cf-only myapp --on --json # same for every domain of a Docker appmz cf refresh --json # refresh the Cloudflare IP ranges nowAuthoritative BIND9 zones (zoneDNS tab) use the mz dns sub-commands:
mz dns zone-list --json # zones served by BIND9 on this boxmz dns record-add example.com --name @ --type A --value 1.2.3.4 --jsonSee The mz CLI and the command catalog.
Automate it (MCP / REST)
Section titled “Automate it (MCP / REST)”MCP (mcp.mzpanel.com) and the REST API (/v1/api, same token) are on every plan.
Call jobs_schema (or GET /v1/api/job-kinds/{type}) before jobs_create /
POST /v1/servers/{id}/jobs to get each kind’s exact body, token level and scope.
| Goal | MCP tool | REST / job |
|---|---|---|
| Domains across the fleet | servers_domains_all | GET /v1/servers/domains/all |
| Certificates on a box | ssl_list, servers_inventory with kind ssl | ssl.list |
| Issue / renew / delete a cert | ssl_renew, jobs_create | ssl.issue, ssl.renew, ssl.delete, ssl.auto-renew, ssl.https-redirect |
| Live DNS health | jobs_create | dns.lookup |
| Cloudflare only (read / on / off) | jobs_create | site.cf-only {domain, mode?: "on" | "off"}, app.cf-only {name, mode?} (no mode = read state + whether DNS is proxied) |
| Cloudflare IP ranges on the box | jobs_create | cf.status (read), cf.refresh |
| Cloudflare records | dns_connections_list, dns_records_list, dns_records_create, dns_records_update | control-plane routes |
| Edge cache / proxy | dns_edge_get, dns_edge_purge | |
| Wildcard, Origin or custom certs | dns_wildcard_cert, dns_wildcard_certs_list, dns_origin_cert, dns_csr, dns_install_cert | |
| Registrar expiry tracking | domains_registrations_list, domains_registrations_track |
Deleting a BIND9 zone (dns.zone-delete) needs the data:delete scope.
Gotchas & troubleshooting
Section titled “Gotchas & troubleshooting”- Cloudflare only refused with
not_proxied. The domain (or itswww.name, when the site serves it) resolves to an address outside Cloudflare, or does not resolve. Turning the guard on then would take the site offline, so nothing changed. Proxy the record (orange cloud), wait for DNS, retry.nginx_test_failedmeans nginx rejected the change and the vhost was put back. - Site on a two-level name (
app.dev.example.com) shows a TLS error through Cloudflare. Cloudflare’s free edge certificate covers onlyexample.comand*.example.com, so a proxied record one level deeper fails the handshake before reaching your server. The DNS record MZPanel creates for a new site is therefore DNS-only for such names (it is proxied only when the edge certificate covers it). For an older proxied record, switch it to DNS-only, then issue a Let’s Encrypt certificate (ssl.issue). - DNS records MZPanel created for a site go with it. When you create a site in a connected Cloudflare zone, MZPanel adds its A/AAAA records (unless the name already has one). Deleting the site removes those records again, but only if they are unchanged: a record you edited, or one you created yourself, stays. For a DNS-only record MZPanel also issues the Let’s Encrypt certificate right after creating it, so a new site does not stay on its temporary self-signed certificate.
- Writing records needs a connected Cloudflare token. Without one, the DNS
records tab is read-only — it shows the
digview and tells you exactly which A record to create at your provider. Connect a scoped token (minimumZone.DNS:Edit+Zone.Zone:Read; addSSL and Certificates: Editfor Origin Certificates) under DNS providers — never the Global API Key. - “Direct to IP — exposed” is a caution, not an error. A bare A record pointing straight at the server’s public IP works, but it exposes the origin. Enabling the Cloudflare proxy (orange cloud) hides it. Only the proxied state shows green.
- Force HTTPS needs a certificate first. The HTTPS toggle is disabled until a certificate exists — issue one, then turn on the redirect.
- Auto-renew is Let’s Encrypt-only. Self-signed and Cloudflare Origin certificates don’t renew via certbot; there’s no toggle for them, and “Re-issue (auto)” simply re-creates the cert.
- Live signals need the agent online. The domain list and certificate status
render from the last cached snapshot when the server is offline, but
diglookups and every issue/renew/toggle action need a live agent. - BIND9 is a single point of failure. Running one authoritative nameserver on one VPS means the whole domain’s DNS — web, mail and every subdomain — goes down if that box does. Proper authoritative DNS wants at least two nameservers on separate networks. The nameservers drawer says so up front; use it only if you specifically want vanity nameservers. You provide the nameserver hostnames and create the glue records at your registrar — MZPanel is not a DNS registrar.
- zoneDNS is gated on setup, not a mock. The BIND9 tab is fully live: it prompts
to install the
bind9extension inline (streamed), then to set your nameservers, before showing zones. A zone auto-creates only for a domain whose nameservers point here; if you delegated after creating the site, hit Sync.
Related
Section titled “Related”- DNS providers — connect a Cloudflare token for record editing and automated SSL.
- Sites on a server — the domains that show up here.
- The mz CLI — driving the box from the command line.