Get DNS Records for a Domain
GET /api/dns/{domain}
Retrieve the DNS records required to activate email delivery for a domain. Add these records at your domain registrar or DNS provider.
Path Parameters
The domain name to retrieve DNS records for (e.g.,
example.com). The domain must already be registered in your UGMail account.Example Request
Example Response
Response Fields
MX (Mail Exchanger) records that route inbound email for your domain to UGMail’s mail servers.
TXT records for SPF and DKIM configuration.
Understanding the Records
The API returns three types of records, each serving a distinct purpose:MX Record — Inbound Mail Routing
The MX record tells other mail servers where to deliver email for your domain. Add exactly one MX record pointing tomail.ugmail.co with the priority value provided.
SPF Record — Sender Authorization
The SPF TXT record tells receiving servers which hosts are authorized to send email on behalf of your domain. This reduces the chance of your mail being marked as spam.DKIM Record — Cryptographic Signing
The DKIM TXT record publishes your domain’s public key so receiving servers can verify that outgoing messages were signed by UGMail. Add this record atugmail._domainkey.example.com (replacing example.com with your domain).
See the DKIM Configuration page for step-by-step instructions on setting up DKIM signing.
Adding Records at Your Registrar
1
Copy the records from the API response
Call
GET /api/dns/{domain} and note the exact values returned for your domain.2
Log in to your DNS provider
Go to the DNS management console for your domain. This is typically your domain registrar (e.g., Namecheap, GoDaddy, Cloudflare, Route 53).
3
Add the MX record
Create an MX record with the host, value, and priority from the API response. Remove any existing MX records pointing to a different provider if you are migrating.
4
Add the SPF TXT record
Create a TXT record at
@ (root) with the SPF value. If you already have an SPF record, merge the include:ugmail.co mechanism into it rather than creating a second TXT record.5
Add the DKIM TXT record
Create a TXT record at
ugmail._domainkey with the full DKIM public key value from the API response.DNS changes typically propagate within a few minutes to a few hours, but can take up to 48 hours in some cases. You can verify propagation using a tool like MXToolbox.

