DNS
DigitalOcean hosts DNS for your domains for free. Point the domain’s nameservers at ns1.digitalocean.com, ns2.digitalocean.com and ns3.digitalocean.com at your registrar, then manage its records here. A domain on DigitalOcean DNS can also get Let’s Encrypt certificates for its load balancers.
example.com
| name | type | data | ttl |
|---|---|---|---|
| @ | A | 203.0.113.10 | 1800 |
| www | CNAME | @ | 1800 |
| @ | MX | mail.example.com · priority 10 | 3600 |
| @ | TXT | v=spf1 include:_spf.example.com ~all | 3600 |
Add a domain
Section titled “Add a domain”yield* DigitalOcean.Domain("Example", { name: "example.com" });Add records
Section titled “Add records”yield* DigitalOcean.DomainRecord("Apex", { domain: "example.com", type: "A", name: "@", data: ip.ip,});yield* DigitalOcean.DomainRecord("Www", { domain: "example.com", type: "CNAME", name: "www", data: "@" });yield* DigitalOcean.DomainRecord("Mail", { domain: "example.com", type: "MX", name: "@", data: "mail.example.com.", priority: 10,});data takes Outputs, so a record follows the Droplet, load balancer or reserved IP it points at. ttl defaults to 1800 seconds.
Limits
Section titled “Limits”- DigitalOcean DNS answers for a domain only once the registrar points it at DigitalOcean’s nameservers.