This guide walks you through running the DNS Handling service locally and taking a domain through its complete lifecycle: registration, ownership verification, certificate issuance, and retrieval. By the end you will have a running server, a verified domain, and a stored certificate record.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/plutoploy/dns-handling/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you begin, make sure you have the following:
- Go 1.26 or later installed and
goavailable on yourPATH. - A LibSQL-compatible database or file-based SQLite (the default
file:./tls.dbrequires no extra setup). - A real domain name whose DNS you can edit — the service performs live TXT lookups, so a domain that only exists locally will not work.
- An email address to register with the ACME provider (used for expiry notifications).
Clone and build
Clone the repository and compile the server binary:The compiled binary is placed at
./tls-server in the project root.Configure environment
Copy The service reads all configuration from environment variables at startup via
.env.example and fill in your values:config.Load(). Every variable has a sensible default, so you only need to override what differs from the defaults shown above.Run the server
Export the variables and start the binary:You should see structured JSON log output similar to:The service is ready to accept requests once the
listening log line appears. It binds to :8080 by default.Register a domain
Submit the domain name you want to manage. The service creates a record in status Response (Save the
pending and returns a unique verification_token:201 Created):id — you will need it for every subsequent request against this domain.Create the DNS TXT record
Log in to your DNS provider and add a TXT record exactly as instructed in the
DNS changes can take anywhere from a few seconds to several minutes to propagate. You can check propagation with:
instructions field:| Field | Value |
|---|---|
| Type | TXT |
| Host / Name | _acme-challenge.example.com. (or _acme-challenge if your provider appends the zone automatically) |
| Value | The verification_token string from the previous response |
| TTL | 60 seconds (lower is better for faster propagation) |
Verify domain ownership
Once the TXT record is live, trigger the verification check. The server performs a live DNS TXT lookup and, if the token matches, advances the domain to Response (
verified:200 OK):Issue a certificate
Initiate an ACME DNS-01 order. The service registers or reuses an ACME account, opens an order with the configured ACME directory, and immediately returns while a background goroutine polls DNS every 10 seconds (timeout: 5 minutes):Response (Update (or create) the
202 Accepted):_acme-challenge.example.com. TXT record with the expected_txt_value shown in this response. This is a different value from the verification token — it is the ACME key authorisation value specific to this certificate order.The background poller detects the record, calls back to Let’s Encrypt to complete the challenge, stores the issued certificate and private key, and moves the domain to active. Watch the server logs for "acme dns-01 record found" and "certificate issued".