This topic describes how to configure DNS records to point a domain name to a service, such as a web server or an email provider. This allows users to access your website or use a custom email address with your domain name.
Overview
The Domain Name System (DNS) translates human-readable domain names (such as www.example.com) into machine-readable IP addresses (such as 192.0.2.1). When a user enters your domain name into a browser, DNS resolves the domain name to the correct IP address, allowing the browser to connect to your server.
Before you begin
Obtain your website server's public IP address: You need the IP address of your website server in IPv4 format, such as
192.0.2.0.For Alibaba Cloud Elastic Compute Service (ECS) users: Find the public IP address in the ECS console.
For other cloud servers: Contact your service provider to obtain the public IP address.
Verify your domain name status: Use a WHOIS lookup tool to confirm that your domain name status is
ok.
This topic uses Alibaba Cloud DNS as an example. If you are using a different DNS provider, follow their documentation to configure DNS records.
Quick links: Configure website resolution | Configure email resolution | Configure subdomain resolution
Use case 1: Configure DNS records for a Website
This procedure shows how to point a domain name (such as example.com) to your web server's IP address.
Go to the Domain Names page in the Domain Names console.
Find the domain name that you want to configure and click Resolve in the Actions column.
On the page that appears, click the ··· icon next to Add Record and click Quick Add Website DNS.

Confirm that your domain name's DNS servers are configured correctly by checking the status message at the top of the page. If an error is displayed, you must resolve the DNS server issue before proceeding. Otherwise, your DNS records will not take effect.
In the Quick Add Website DNS dialog box, configure the parameters.
An
@hostname represents the root domain (the domain without any prefix, such asexample.com).To configure a subdomain, select the corresponding checkbox.

Enter the public IP address of your website server and click OK to save the record.

This procedure creates common DNS records (A record, AAAA record, CNAME record). To add other record types, click Add Record on the DNS settings page. For more information, see Add a DNS record.
Use case 2: Configure DNS records for an email service
This procedure shows how to configure the mail exchange (MX) records required for your email service.
Go to the Domain Names page in the Domain Names console.
Find the domain name that you want to configure and click Resolve in the Actions column.
On the page that appears, click the ··· icon next to Add Record and click Quick Add Mailbox DNS.

In the Quick Add Mailbox DNS dialog box, select your mail service provider.

Click OK. The system automatically adds the required MX records.
MX record changes usually take up to 2 hours to propagate globally. Allow sufficient time for propagation before testing your email service.
If your email provider is not listed in the Quick Add Mailbox DNS dialog box, you must add the records manually.
Use case 3: Configure DNS records for a subdomain
A subdomain is a prefix added to your root domain, such as blog.example.com or api.example.com. You can use subdomains to point different parts of your domain name to different services or servers.
Configuration examples:
Use case | Hostname | Record type | Record value |
Point blog.example.com to a server IP address | blog | A | 192.0.2.10 |
Point api.example.com to another service | api | CNAME | cname.otherservice.com |
Procedure:
Subdomains do not need to be registered separately. Follow the same procedure as configuring a DNS record for a website, but specify the subdomain in the Hostname field.
Go to the Domain Names page in the Domain Names console.
Find the domain name that you want to configure and click Resolve in the Actions column.
On the page that appears, click Add Record.
Configure the parameters:
Record Type: Select
AorCNAMEas required.Hostname: Enter the subdomain, such as
blog,shop, orapi.Record Value: Enter the IP address or domain name of the destination server.
Click OK to save the record.
Verify DNS resolution
Propagation time
New DNS records: Take effect almost immediately.
Modified DNS records: The time for a change to propagate depends on the record's Time to Live (TTL) value. For example, a record with a TTL of 10 minutes should propagate globally within 10 minutes.
However, some recursive name servers may not honor the TTL, causing propagation to take up to 48 hours. To ensure a smooth transition, keep the service available at both the old and new IP addresses during this period.
Before modifying a DNS record, lower its TTL and wait for the original TTL to expire.
After the change, keep the service running on both the old and new IP addresses for at least one full TTL cycle.
Verify propagation
Browser test: Open a web browser and enter your domain name (such as
http://your-domain.com) to confirm that your website loads correctly.CLI test: Use the dig or nslookup command in your local terminal to query the DNS record.
If the query result matches the Record Value you configured, the record has propagated to your local DNS resolver.
If they do not match, your local DNS cache may be stale. You can wait for the cache to update or see Quickly troubleshoot DNS resolution failures for troubleshooting steps.
Common record types
Record type | Description | Record value | Common use cases |
A | Points a domain name to an IPv4 address. | An IPv4 address, such as 192.0.2.1 | Website DNS resolution |
AAAA | Points a domain name to an IPv6 address. | An IPv6 address, such as 2001:db8::1 | Providing IPv6 access for a website |
CNAME | Points a domain name to another domain name (an alias), allowing for indirect resolution. | Another valid domain name | Pointing a domain name to a CDN or SaaS service |
MX | Specifies the mail server that handles emails for the domain name. | A priority (a number) followed by a mail server domain name | Business email configuration |
TXT | Lets you associate arbitrary text with a domain name, often for verification purposes or for email security policies like SPF. | A free-form text string | Domain ownership verification (such as for SSL and email) and email security (SPF, DKIM, DMARC). |
References
Avoid DNS record conflicts: You cannot create both a CNAME record and another record type (like A or MX) for the same hostname. Also, avoid creating circular CNAME records. For more information, see Resolve record conflict rules.
Troubleshooting: Quickly troubleshoot DNS resolution failures