This topic answers frequently asked questions about DNS resolution.
DNS resolution
- What is DNS resolution?
After you purchase an ECS instance, the system assigns it an IP address. Because IP addresses consist of numbers and are difficult to remember, a domain name serves as a memorable alias. For example,
example.aliyundoc.comis a domain name that corresponds to an IP address. DNS resolution is a service that points a domain name to the IP address of a website, letting users access the website by its domain name.Alibaba Cloud provides DNS resolution services through Alibaba Cloud DNS. Alibaba Cloud DNS is a secure, fast, stable, and scalable authoritative DNS service. It helps enterprises and developers translate easy-to-manage domain names into the numerical IP addresses that computers use for network communication, thereby routing user traffic to the appropriate website or application server. For more information, see Alibaba Cloud DNS.
- Why do I need to configure DNS resolution?
For users to access your website by its domain name, you must complete DNS resolution. This is a mandatory step after you purchase an ECS instance, deploy your website, and purchase a domain name.
- How do I configure DNS resolution?
Most domain name registrars in the Chinese mainland provide their own DNS servers. If you use Alibaba Cloud DNS, follow the instructions in the documentation. For more information, see Beginner's guide to Alibaba Cloud DNS.
A record
When you configure DNS resolution, you must select a record type. This section explains what an A record is.
If you purchase multiple domain names and want to point them all to the same web server, you need to point each of these domain names to your server. Second-level and third-level domains under a top-level domain are all considered subdomains.
If you change your ECS instance, you must update the DNS records for all domains that point to the old server, which can be a laborious process. A CNAME record simplifies this task.
CNAME record
A CNAME record, also known as an alias record, maps a domain name to another domain name. It is commonly used for mail services and Content Delivery Network (CDN) acceleration.
If you want to use a CDN to accelerate your website, configuring a CNAME record is a critical step. After you enable a CDN service and add your domain name, the CDN provider assigns a CNAME. You must point your domain name to this CNAME so that requests to your accelerated domain name are routed to a CDN node. This process accelerates content delivery. For instructions, see Configure a CNAME record.
The domain name that a CNAME record points to must ultimately resolve to an A record.
Differences between CNAME and A records
An A record maps a domain name to an IP address, while a CNAME record maps a domain name to another domain name.
If you plan to run a website long-term, we recommend using CNAME records. CNAME records enable CDN acceleration, which helps hide your origin server's IP address and reduces attack risks.
CNAME records in CDN acceleration
The main function of a CDN is to cache content from your origin server on nodes (cache servers) that are geographically closer to your users. This speeds up content delivery. To learn more about how CNAME records enable this process, see how acceleration works.