Back to HomeAlibaba Cloud

Alibaba Cloud CDN and DNS Tutorial: Acceleration Setup, DDoS Protection Complete Guide

13 min min read
#Alibaba Cloud#CDN#DNS#DDoS Protection#Web Acceleration#Network Security#Cloud Services

Alibaba Cloud CDN and DNS Tutorial: Acceleration Setup, DDoS Protection Complete Guide

Website loading too slow, users leave before it finishes. Worse, once hit by a DDoS attack, the website goes down completely. These problems can be solved through proper CDN and DNS configuration.

Alibaba Cloud has unique advantages in network acceleration and security protection, especially in the China market. This article details Alibaba Cloud's DNS services, CDN acceleration configuration, and DDoS protection features to help you build a fast and secure website.

Want to learn more about Alibaba Cloud services? See Alibaba Cloud Complete Guide.

Alibaba Cloud DNS Services Introduction

Alibaba Cloud DNS is a domain name resolution service that converts domain names to IP addresses.

Core DNS Features

Alibaba Cloud DNS isn't just simple domain resolution—it offers multiple advanced features:

Smart Resolution (GeoDNS)

This is one of Alibaba Cloud DNS's most practical features. The system automatically returns the optimal IP address based on the user's geographic location.

For example, you can set up:

  • China users → Resolve to Alibaba Cloud China data center
  • Taiwan users → Resolve to Hong Kong data center
  • EU/US users → Resolve to Singapore or US data center

This way users from each region connect to the nearest server, significantly reducing latency.

Multi-line Resolution

For China's complex network environment, Alibaba Cloud DNS supports multi-line resolution:

  • China Telecom users → Telecom IP
  • China Unicom users → Unicom IP
  • China Mobile users → Mobile IP

This is particularly important within China because interconnection speed between different carriers is slower.

High Availability Architecture

Alibaba Cloud DNS provides 100% SLA guarantee with distributed architecture:

  • Multiple global DNS nodes
  • Automatic failover
  • Millisecond-level resolution response

DNS Service Version Comparison

Alibaba Cloud DNS offers free and multiple paid versions:

FeatureFreePersonalEnterprise StandardEnterprise Premium
Subdomain count1030100Unlimited
Smart resolution lines21020Unlimited
Minimum TTL600s120s60s1s
URL forwarding
Search engine resolution
DDoS protectionBasicEnhancedAdvancedPremium

For general websites, the free version is sufficient. Enterprise applications should choose Enterprise Standard or higher for more granular line control and faster TTL updates.

Alibaba Cloud CDN Acceleration Service

CDN (Content Delivery Network) works on a simple principle: cache your website content on nodes around the world, so users get content from the nearest node instead of connecting back to your origin server every time.

Alibaba Cloud CDN Advantages

Alibaba Cloud CDN has unique advantages in the China market:

Node Coverage

Alibaba Cloud CDN has 2,800+ global nodes, including:

  • China domestic nodes: 2,300+
  • Overseas nodes: 500+

This node density within China is unmatched by other cloud providers. If your users are mainly in China, Alibaba Cloud CDN is the best choice.

Protocol Support

  • HTTP/2: Reduces connections, improves performance
  • QUIC: Reduces latency, improves weak network experience
  • WebSocket: Supports real-time communication applications

Use Cases

Alibaba Cloud CDN is suitable for:

ScenarioDescriptionEffect
Website accelerationStatic resource caching (images, CSS, JS)50-80% faster page loading
Large file downloadSoftware, game update package distributionStable high-speed download
Video streamingLive and on-demand content distributionSmooth playback, less buffering
Dynamic acceleration (DCDN)API requests, dynamic page accelerationOrigin path optimization

CDN and Origin Server Relationship

Many people ask: Do I still need my own server with CDN?

Yes, you do. CDN is just a caching layer—you still need an origin server to store original content. CDN nodes pull content from the origin server, cache it, and serve it to users.

Common origin configurations:

DDoS Protection Features

Website security is another important topic. DDoS (Distributed Denial of Service) attacks are one of the most common network attacks, overwhelming your website with massive traffic.

Alibaba Cloud DDoS Protection Plans

Alibaba Cloud offers multi-tier DDoS protection:

Basic DDoS Protection (Free)

All Alibaba Cloud users automatically get basic protection:

  • Protection capability: Attacks under 5 Gbps
  • Coverage: ECS, SLB, EIP, etc.
  • No additional configuration needed

For small websites, this free quota is usually sufficient.

DDoS High Protection IP

When attack traffic exceeds basic protection capability, you need High Protection IP:

PlanProtection CapabilityUse CaseReference Monthly Fee
High Protection IP (Standard)30-100 GbpsGeneral enterprise websites¥10,000+
High Protection IP (Enhanced)100-300 GbpsFinance, gaming¥30,000+
High Protection IP (Ultra)300 Gbps-1 TbpsLarge platformsCustom quote

Web Application Firewall (WAF)

DDoS protection blocks traffic attacks; WAF protects against application layer attacks:

  • SQL injection
  • XSS cross-site scripting
  • CSRF cross-site request forgery
  • Malicious crawlers

WAF and DDoS High Protection can be used together for complete security protection.

DDoS Protection Selection Recommendations

How to choose the right protection plan?

  1. Small websites: Use free basic protection
  2. E-commerce websites: At least configure WAF, temporarily upgrade to High Protection during important periods (like Singles' Day)
  3. Finance/Gaming: These industries are high-attack targets—go directly to High Protection IP
  4. Uncertain needs: Start with basic, upgrade in real-time when attacked

Worried about website attacks? DDoS attack costs far exceed protection costs. Schedule Security Assessment, let us help you review potential risks.


DNS Setup Tutorial

Now let's get into practice. Starting with DNS setup.

Step 1: Add Domain

  1. Log into Alibaba Cloud console
  2. Search for "Cloud DNS" to enter the service
  3. Click "Add Domain"
  4. Enter your domain (e.g., example.com)

Step 2: Modify NS Records

After adding the domain, Alibaba Cloud provides NS (Name Server) records. You need to modify NS settings at your domain registrar.

Common registrar NS modification locations:

  • GoDaddy: Domain Settings → Nameservers
  • Namecheap: Domain List → DNS
  • Google Domains: DNS → Custom nameservers

Alibaba Cloud's NS records are usually:

dns1.hichina.com
dns2.hichina.com

After modification, wait 24-48 hours to take effect (usually just a few hours).

Step 3: Add Resolution Records

After NS records take effect, you can start adding resolution records.

Common Record Types:

Record TypePurposeExample Value
ADomain points to IPv4 address1.2.3.4
AAAADomain points to IPv6 address2001:db8::1
CNAMEDomain points to another domaincdn.example.com
MXMail servermail.example.com
TXTText record (for verification)v=spf1 include:...

Configuration Example:

Assuming your website IP is 47.52.1.1:

Host Record: @
Record Type: A
Record Value: 47.52.1.1
TTL: 600

This makes example.com point to your server.

To set up www.example.com:

Host Record: www
Record Type: A
Record Value: 47.52.1.1
TTL: 600

Step 4: Configure Smart Resolution (Optional)

If you have multiple servers in different regions, enable smart resolution:

  1. On the resolution records page, click "Add Record"
  2. Select "Resolution Line"
  3. Set different IPs for different lines

For example:

  • Default line → Hong Kong server IP
  • China Telecom → China Telecom IP
  • China Unicom → China Unicom IP

CDN Setup Tutorial

After DNS setup, configure CDN next.

Step 1: Add Acceleration Domain

  1. Log into Alibaba Cloud console, enter "CDN" service
  2. Click "Domain Management" → "Add Domain"
  3. Enter acceleration domain (e.g., cdn.example.com or www.example.com)

Business Type Selection:

  • Small files/images: Suitable for general websites
  • Large file download: Suitable for software download sites
  • Video streaming: Suitable for video websites
  • Full-site acceleration: Accelerate both static and dynamic content

Step 2: Configure Origin Server

The origin server is your original server. Three configuration methods:

Method 1: IP Address

Origin Type: IP
Origin Address: 47.52.1.1
Port: 80 (HTTP) or 443 (HTTPS)

Method 2: Domain

Origin Type: Origin Domain
Origin Address: origin.example.com
Port: 80 or 443

Method 3: OSS Domain

Origin Type: OSS Domain
Bucket: your-bucket.oss-cn-hongkong.aliyuncs.com

Step 3: Configure CNAME

After adding the domain, Alibaba Cloud provides a CNAME record in a format like:

cdn.example.com.w.kunlunsl.com

You need to point the acceleration domain to this CNAME in DNS settings:

Host Record: cdn (or www)
Record Type: CNAME
Record Value: cdn.example.com.w.kunlunsl.com
TTL: 600

Step 4: Configure HTTPS (Highly Recommended)

All websites today should use HTTPS. In the CDN console:

  1. Go to Domain Management → Select your domain
  2. Click "HTTPS Configuration"
  3. Enable HTTPS
  4. Upload SSL certificate, or use Alibaba Cloud free certificate

HTTPS Configuration Options:

  • Force HTTPS: Recommended to enable, automatically redirect HTTP requests to HTTPS
  • HSTS: Enhanced security, tells browsers to only use HTTPS
  • HTTP/2: Recommended to enable, improves transfer efficiency

Step 5: Cache Strategy Configuration

CDN effectiveness depends on cache strategy settings. Go to "Cache Configuration":

Recommended Cache Times:

File TypeRecommended Cache TimeNotes
Images (.jpg, .png, .gif)30 daysImages rarely change
CSS, JS7 daysVersion control via filename
HTML1 hour or no cacheNeeds real-time updates
API responsesNo cacheDynamic content

Cache Key Settings:

Recommend enabling "Ignore URL Parameters" so image.jpg?v=1 and image.jpg?v=2 are treated as the same file. But if you use parameters for version control, keep parameters.


CDN configuration looks simple, but has many details. Wrong settings can make your website slower or generate high fees. Schedule CDN Assessment, let experts review your configuration.


Pricing Comparison

After understanding features and setup, let's look at pricing.

DNS Service Pricing

Service VersionAnnual FeeUse Case
Free$0Personal websites, small projects
Personal¥99/yearIndividual webmasters, small businesses
Enterprise Standard¥1,188/yearMedium enterprises
Enterprise Premium¥11,880/yearLarge enterprises, critical business

CDN Pricing

Alibaba Cloud CDN has two billing methods:

Pay-by-Traffic

RegionUnit Price
Mainland China¥0.24/GB
Hong Kong/Taiwan/Japan/Korea¥0.75/GB
EU/US¥0.49/GB

Pay-by-Bandwidth Peak

BandwidthMainland China Monthly Fee
1-10 Mbps¥30/Mbps/month
10-100 Mbps¥25/Mbps/month
100-500 Mbps¥22/Mbps/month

How to Choose Billing Method?

  • High traffic fluctuation, occasional peaks → Pay-by-traffic
  • Stable traffic, continuous high traffic → Pay-by-bandwidth

Generally, small to medium websites should choose pay-by-traffic for easier cost control.

DDoS Protection Pricing

ServiceCostNotes
Basic ProtectionFreeUnder 5 Gbps
High Protection IP (30G)¥10,400+/monthIncludes basic bandwidth
WAF¥1,768+/monthApplication layer protection

Money-Saving Tips:

  1. Use CDN for traffic offloading: CDN itself has some attack buffering capability
  2. Buy on demand: Use free version normally, upgrade in real-time when attacked
  3. Annual discount: Annual payment typically saves 15-20%

Cost Calculation Example

Assume a medium e-commerce website:

  • Daily average traffic: 100 GB
  • Main users: China 80%, Taiwan 20%
  • Need basic security protection

Monthly Cost Calculation:

ItemCalculationCost
DNS (Enterprise Standard)¥1,188 ÷ 12¥99/month
CDN (Mainland China)100GB × 30 × 0.8 × ¥0.24¥576/month
CDN (Taiwan)100GB × 30 × 0.2 × ¥0.75¥450/month
DDoS Basic ProtectionFree¥0
Total≈¥1,125/month

Actual costs vary based on traffic distribution and usage patterns.

FAQ

CDN setup but website is actually slower?

Possible causes:

  1. Cache not hitting: Check cache configuration, ensure static resources are correctly cached
  2. Origin too far: Ensure origin is in appropriate region
  3. HTTPS not configured properly: Ensure both CDN and origin support HTTPS

How long does DNS modification take to take effect?

Theoretically, after TTL time expires. But due to various DNS caches, usually:

  • New records: Minutes to hours
  • Modified records: Old TTL time (possibly 24-48 hours)

Recommend lowering TTL before making changes.

What's the difference between CDN and VPN?

Completely different things:

  • CDN: Accelerates website content delivery, transparent to users
  • VPN: Network proxy tool, changes user's network exit

Using CDN requires no user configuration.

Does China CDN require ICP filing?

Yes. To use Alibaba Cloud's mainland China CDN nodes, your domain must complete ICP filing.

Hong Kong, Taiwan, and other region nodes don't require filing.

What to do when hit by DDoS attack?

  1. Confirm attack: Check cloud monitoring, confirm if it's really an attack
  2. Enable High Protection: If exceeding basic protection, immediately purchase High Protection IP
  3. Contact support: Alibaba Cloud has 24/7 security emergency service
  4. Analyze source: After attack ends, analyze logs and strengthen protection strategies

How to know if CDN is working?

Several methods:

  1. Check HTTP Headers: Correctly configured will show X-Cache: HIT
  2. Use speed test tools: Compare loading times with and without CDN
  3. Check console: Alibaba Cloud console has hit rate statistics

Website Too Slow? CDN May Be the Answer

Website speed affects user experience and SEO ranking:

  • 1 second slower loading: 7% conversion rate drop
  • Not loaded within 3 seconds: 53% of users leave

CDN choice affects performance and cost—choosing wrong makes it more expensive.

Schedule CDN Assessment, let us help you:

  • Analyze current performance bottlenecks
  • Recommend the most suitable CDN solution
  • Plan DDoS protection strategy

Related Articles

Need Professional Cloud Advice?

Whether you're evaluating cloud platforms, optimizing existing architecture, or looking for cost-saving solutions, we can help

Book Free Consultation

Related Articles