Adding a domain you own to your DigitalOcean account lets you manage the domain’s DNS records with the control panel and API. Domains you manage on DigitalOcean integrate with DigitalOcean Load Balancers and Spaces to streamline automatic SSL certificate management.
Each type of DNS record has its own values and settings, and the sections below explain what each of these records are used for and how to configure them.
All DNS records have one value in common: TTL, or time to live. TTL determines how long the record remains cached in an ISP’s DNS resolver before it expires.
Keeping records cached in local resolvers across the internet helps improve your website’s performance but it may mean that your site’s users don’t see DNS updates immediately. Setting a record’s TTL is a balance between performance and propagation of changes. If you don’t intend to update record data frequently, a higher TTL like 3600 (1 hour) or 86400 seconds (24 hours) is reasonable. If you update records often, a lower TTL like 300 (5 minutes) or 600 seconds (10 minutes) ensures changes propagate more quickly.
Some of these commands require you to provide the record’s ID. You can retrieve a list of records and their IDs for a domain by using the doctl compute domain records list <domain>
command.
Some of these calls require you to provide the record’s ID. You can retrieve a list of records and their IDs for a domain using the /v2/domains/$DOMAIN_NAME/records
endpoint.
You can add, modify, and delete DNS records for a domain from the Networking page. From the control panel, click the Networking in the main menu, then click on the domain you would like to manage.
To create a record, select the record type below the heading, fill in the fields required for that record type, and then click Create record. The supported record types section below provides detailed configuration instructions for each type.
To modify or delete a record, open the record’s More menu.
Click Edit record to change the values for that record. To permanently delete the record, click Delete, then click Delete Record in the confirmation window.
An A record maps an IPv4 address to a domain name. This determines where to direct any requests for a domain name.
On DigitalOcean, A records have the following fields.
The apex of a domain (@
). To map an apex domain, like example.com
, to an IPv4 address, enter the @
symbol.
A subdomain prefix, such as www
. To create a subdomain, enter a subdomain prefix. For example, to create www.example.com
, enter www
in the field.
A wildcard (*
). Wildcard records direct requests for a non-existent subdomain to a specified resource or IP address. For example, if you type help.example.com
into your browser and the domain example.com
doesn’t have a DNS record for that subdomain, the wildcard record directs you to the resource or IP address specified in its WILL DIRECT TO field. However, if any kind of DNS record exists for a subdomain, the existing record takes priority and the wildcard record is not applied. In this case, you need to explicitly define an A record for the subdomain. To create a wildcard record, enter a *
into the HOSTNAME field.
Setting an A record using DigitalOcean DNS looks like this:
In this example, the hostname is set to www
. This instructs the DNS to direct traffic looking for www.example.com
to the specified Droplet, ubuntu-1gb-sfo2-01
with the IP address 203.0.113.5
.
An AAAA record, also called a Quad A record, maps an IPv6 address to a domain name. This determines where to direct requests for a domain name in the same way that an A record does for IPv4 addresses.
On DigitalOcean, AAAA records have the following fields.
The apex of a domain (@
). To map an apex domain, like example.com
, to an IPv4 address, enter the @
symbol.
A subdomain prefix, such as www
. To create a subdomain, enter a subdomain prefix. For example, to create www.example.com
, enter www
in the field.
A wildcard (*
). Wildcard records direct requests for a non-existent subdomain to a specified resource or IP address. For example, if you type help.example.com
into your browser and the domain example.com
doesn’t have a DNS record for that subdomain, the wildcard record directs you to the resource or IP address specified in its WILL DIRECT TO field. However, if any kind of DNS record exists for a subdomain, the existing record takes priority and the wildcard record is not applied. In this case, you need to explicitly define an A record for the subdomain. To create a wildcard record, enter a *
into the HOSTNAME field.
Setting an AAAA record using DigitalOcean DNS looks like this:
In this example, the hostname is set to www
. This instructs the DNS to direct traffic looking for www.example.com
to the specified Droplet, ubuntu-1gb-sfo2-01
with the IP address 2001:0d8:2:d0::24:9001
.
A CNAME record defines an alias for an A record and points one domain to another domain instead of an IP address. When the associated A record’s IP address changes, the CNAME directs traffic to the new address.
On DigitalOcean, CNAME records have the following fields.
The apex of a domain (@
). To map an apex domain, like example.com
, to an IPv4 address, enter the @
symbol.
A subdomain prefix, such as www
. To create a subdomain, enter a subdomain prefix. For example, to create www.example.com
, enter www
in the field.
Setting an CNAME record using DigitalOcean DNS looks like this:
In this example, the subdomain staging.example.com
directs traffic to the domain’s apex (@
), example.com
.
An MX record specifies the mail servers responsible for accepting email on behalf of your domain. Providers often make multiple name servers available so that if one is offline, another can respond. Each server needs its own MX record.
On DigitalOcean, MX records have the following fields.
@
).The Add Gmail MX Records add records for each of Google’s mail servers automatically for use with G Suite.
Setting an MX record using DigitalOcean DNS looks like this:
In this example , the hostname is set to the apex domain @
, indicating it applies to the entire domain. The MX record specifies that mail for example.com
should be delivered to the mail server mail.example.com
with a priority of 1
.
A TXT record is used to associate a string of text with a hostname. These are primarily used to verify that you own a domain.
On DigitalOcean, TXT records have the following fields.
example_name=example_value
.The apex of a domain (@
). To map an apex domain, like example.com
, to an IPv4 address, enter the @
symbol.
A subdomain prefix, such as www
. To create a subdomain, enter a subdomain prefix. For example, to create www.example.com
, enter www
in the field.
Setting a TXT record using DigitalOcean DNS looks like this:
In this example, the record is located at the apex of the hostname example.com
and contains a Google site verification string to prove ownership of the hostname.
Sender Policy Framework (SPF) records contain lists of email servers that are authorized to send email on behalf of your domain. SPF records increase your email sending reputation with inbox providers by providing a means to check that your emails are being sent from your domain and not by a malicious user.
SPF records are special TXT records. You can create them using the TXT record option in the control panel.
Setting an SPF record using the TXT record option looks like this:
In this example, the SPF record is located at the apex of the domain, example.com
, and the record’s value authorizes an IP address (in CIDR notation) and an email provider to send email on example domain’s behalf.
Domain Keys Identified Mail (DKIM) records contain public keys used to authenticate email arriving from a domain. When you use DKIM on your email server, your server signs emails with a private key that receiving email servers then validate using the public key contained in a DKIM DNS record. DKIM records increase your email sending reputation with inbox providers by providing a means to check that no one has intercepted or altered the email during transit.
DKIM records are special TXT records. You can create them using the TXT record option in the control panel.
Creating a DKIM record using the TXT record option looks like this:
In this example, the HOSTNAME field contains a domain key prefix and the VALUE field contains the public key for that domain key. This allows receiving email servers to validate that emails for example.com
were signed by the private key corresponding to this public key.
NS records specify the name servers, or servers that provide DNS services, for a domain or subdomain. You can use these to direct part of your traffic to another DNS service or to delegate DNS administration for a subdomain.
On DigitalOcean, NS records have the following fields.
The apex of a domain (@
). To map an apex domain, like example.com
, to an IPv4 address, enter the @
symbol.
A subdomain prefix, such as www
. To create a subdomain, enter a subdomain prefix. For example, to create www.example.com
, enter www
in the field.
A wildcard (*
). Wildcard records direct requests for a non-existent subdomain to a specified resource or IP address. For example, if you type help.example.com
into your browser and the domain example.com
doesn’t have a DNS record for that subdomain, the wildcard record directs you to the resource or IP address specified in its WILL DIRECT TO field. However, if any kind of DNS record exists for a subdomain, the existing record takes priority and the wildcard record is not applied. In this case, you need to explicitly define an A record for the subdomain. To create a wildcard record, enter a *
into the HOSTNAME field.
Creating an NS record using DigitalOcean DNS looks like this:
In the example, the WILL DIRECT TO field specifies that name server queries for the subdomain support.example.com
are directed to the name server ns1.example.net
.
SRV records specify a hostname and port number to direct certain types of traffic to particular servers. Some services, like SIP (Session Initiation Protocol) and XMPP/Jabber (Extensible Messaging and Presence Protocol), require SRV records.
On DigitalOcean, SRV records have the following fields.
_service._protocol
. For example, to create a record for a SIP service that uses UDP, the value would look like this: _sip._udp
.The apex of a domain (@
). To map an apex domain, like example.com
, to an IPv4 address, enter the @
symbol.
A subdomain prefix, such as www
. To create a subdomain, enter a subdomain prefix. For example, to create www.example.com
, enter www
in the field.
fqdn.example.com.
. To use an FQDN, enter the FQDN with a period (.
) at the end. This distinguishes it from a subdomain prefix.5060
.3
.60
. Records with higher numbers receive higher preference.Setting a SRV record using DigitalOcean DNS looks like this:
In the example, the service uses SIP over UDP on port 5060
and directs the traffic to the subdomain sip.example.com
, which hosts the service.
CAA records specify which certificate authorities are permitted to issue certificates for a domain. You can use them to reduce the risk of bad actors from creating unauthorized SSL/TLS certificates for your domain. See our detailed CAA record documentation for detailed information on how to use them.
PTR (pointer) records, also known as an rDNS (reverse DNS) records, map domains name to an IP address.
We automatically create PTR records for Droplets based on the name you give that Droplet in the control panel. The name must be a valid FQDN. For example, using example.com
as the Droplet name creates a PTR record, but ubuntu-s-4vcpu-8gb-fra1-01
or my-droplet
does not. Droplets with IPv6 enabled only have PTR records enabled for the first IPv6 address assigned to it, not to all 16 addresses available.
You cannot manually create PTR records through the DigitalOcean DNS interface.