All Products
Search
Document Center

Alibaba Cloud DNS:Add DNS records for a website

Last Updated:Sep 10, 2025

Configure Domain Name System (DNS) records for a web server to enable access to your website using a domain name, such as example.com, instead of an IP address. This guide describes the procedure for a basic website DNS configuration.

Before you begin

  1. A domain name has been purchased.

    The target domain name must be in the domain name list of Alibaba Cloud DNS - Public Zone. If the domain name is not found:

    1. Domains purchased from Alibaba Cloud are added automatically. If you have not purchased a domain name, you can purchase one from Alibaba Cloud Domain Names.

    2. If you purchase a domain name from a third-party registrar, manually add it to Alibaba Cloud DNS - Public Zone and change the DNS server addresses. For more information, see Migrate DNS services to Alibaba Cloud DNS.

  2. Get the public IP address of your server.

    • If you use an Elastic Compute Service (ECS) instance or a dedicated virtual machine, find the public IP address in the product console. For example, 47.100.XX.XX.

    • If you use a web hosting service, get the public IP address from your provider.

  3. Ensure your website service is running.

    The web application must be running on the server and accessible via its IP address. The server's firewall or security group must allow inbound traffic on port 80 (HTTP) and port 443 (HTTPS).

Procedure

Step 1. Add a record for the root domain (@)

This step points your root domain (for example,example.com) to your server's IP address.

  1. Go to Alibaba Cloud DNS - Public Zone, find the target domain, and click DNS Settings.

  2. Click Add Record. Add a DNS record with the Host set to@. For more information about the form fields, see Add a DNS record.

    Parameter

    Recommended Value

    Description

    Record type

    A

    Points a domain name to an IPv4 address.

    Host

    @

    Represents the primary domain name.

    Resolution line

    Default

    Takes effect for queries from all sources.

    Record value

    Your server's public IP address

    Enter the IP address in the Before you begin section.

    TTL

    10 minutes (600 seconds)

    The amount of time the record is cached in local DNS servers. A lower Time to Live (TTL) helps configuration changes take effect faster. The default value is recommended.

  3. Click OK to save.

    image

Step 2. Add a DNS record for the www subdomain

This step ensures that users can access your website using www.example.com. This is a common access pattern for users.

  1. On the same DNS Settings page, click Add Record again and configure the following parameters:

    Parameter

    Recommended Value

    Description

    Record Type

    CNAME

    Points the www domain name to another domain name.

    Note

    Why is CNAME recommended?

    By pointing the www record to the root domain using a CNAME, you only need to update the A record for the root domain (@) if your server's IP address changes. The www record updates automatically, which simplifies maintenance.

    Host

    www

    Represents the www subdomain.

    Resolution Line

    Default

    Takes effect for requests from all sources.

    Record Value

    example.com

    Enter your primary domain name.

    TTL

    10 minutes (600 seconds)

    Keep the default value.

  2. Click OK.

Step 3. Verify the records

DNS records take some time to propagate globally, usually within the 10-minute TTL you set. You can verify the records in the following ways:

  • Browser access: In a browser, visit http://your-domain.com and http://www.your-domain.com to check whether your website is accessible.

  • Command-line interface: Open a terminal or command prompt on your computer and run the following commands. Check if the returned IP address matches the one you configured.

    nslookup your-domain.com
    nslookup www.your-domain.com

Limits

DNS and ports

The core function of DNS is to translate a domain name into an IP address. It cannot detect or specify a port number.

  • When you access a domain name in a browser, the browser sends a request to port 80 (HTTP) or port 443 (HTTPS) on the server by default.

  • If your web service runs on a non-standard port, such as 8080, users must include the port number when visiting the service, for example, http://example.com:8080. Non-standard ports are generally not suitable for public websites.

Solution: To use a non-standard port, configure a reverse proxy, such as a self-managed Nginx reverse proxy, on the server or use Application Load Balancer (ALB) to forward traffic from port 80 or 443 to the actual port of the backend service, hiding the port details from users.

Billing

  • Public Zone includes a free tier. Adding basic DNS records such as A and CNAME is free.

  • The Free Edition does not include a Service Level Agreement (SLA). For higher quality and more stable DNS services, purchase a paid tier. For more information, see Purchase an instance.

FAQ

Why is my domain name still inaccessible after adding DNS records?

You can troubleshoot the issue based on the following items:

  1. Troubleshoot the issue as follows:

    1. Wait for DNS propagation: It takes time for DNS changes to propagate globally. Wait at least 10 minutes before trying again.

    2. Modern browsers might attempt to connect via HTTPS by default due to mechanisms like HSTS. If your website is not yet configured with an HTTPS certificate, the browser will show an error. Change HTTPS to HTTP in the browser's address bar.

    3. Check the local cache: Clear your browser cache or flush your local DNS cache by using the ipconfig /flushdns (Windows) or sudo dscacheutil -flushcache (macOS) command.

    4. Check server configuration: Confirm that your server's firewall or ECS security group allows traffic on ports 80 and 443.

    5. Check the web service: Log in to your server and confirm that your web service, such as Nginx or Apache, is running correctly.

    6. Check domain and filing status: If your server is in the Chinese mainland, ensure your domain has completed its ICP filing.

How do I point all undefined subdomains, such as blog.example.com, to my website?

Similar to how you add a DNS record for the www subdomain, add a wildcard DNS record with the Host set to *.

Parameter

Recommended Value

Description

Record type

CNAME

Points the * domain name to another domain name.

Host

*

This has the lowest priority and acts as a fallback for all undefined subdomains.

Resolution line

Default

Takes effect for queries from all sources.

Record value

example.com

Enter your primary domain name.

TTL

10 minutes (600 seconds)

Keep the default value.

What do I do if a "DNS record conflict" error?

This error usually means the record you are trying to add conflicts with an existing record. For example, a host (such aswww) cannot have both a CNAME record and any other type of record. See Rules for DNS record conflicts, delete the conflicting record before, and then try again.

Related topics