How CDNs Work

How CDN works


1. The basis of CDN implementation is to set the DNS domain name to CNAME (that is, to point to another domain name, but this domain name also has an A record (that is, the domain name corresponds to the IP)).
2. The function of CNAME is to ask the browser to send the domain name to the server of the CNAME domain name to resolve the IP of the domain name, that is, the local DNS does not perform IP resolution, but the server specified by CNAME resolves it.
3. The IP address to be resolved by the server specified by CNAME is the IP of the CDN's global load balancing device
. 4. When the browser obtains the IP of the global load balancing device, it initiates a content request to this IP. The global load balancing device will send the request to the IP according to the IP. It is processed by the regional load balancing device. The regional load balancing device will select a cache server IP of the nearest user and return it to the global load balancing device. The global load balancing device calls user redirection (or (DNS-based, HTTP-based redirection, IP spoofing, etc.)) to the cache server to get the requested content.
5. In this way, the request needs to be rolled back and forth by several servers, but for the case where the requested content (data amount) is large, the download time of the content will still be shortened. After all, the distance to download the content is shortened, and the network speed is fast. Especially when the amount of data is large, the previous overhead is even more negligible.
6. Initially, the cache server has no data content, but it will obtain the content from the target server you specify in the CDN and cache it in the cache server for later service.



1. A record is an important record for name resolution, which is used to map a specific host name to the IP address of the corresponding host. You can create it manually in the DNS server or by dynamically updating the DNS client.
2.NS record This record specifies the authoritative name server responsible for this DNS zone.
3. The difference between the A record and the NS record is that the A record directly gives the destination IP, the NS record assigns the DNS resolution task to a specific server, and the IP recorded in the NS record is the IP address of the specific server.
4. NS records take precedence over A records, and A records take precedence over CNAME records



Reference original text (basic working process of CDN): http://book.51cto.com/art/201205/338756.htm
Reference original text (Introduction to DNS principle): http://www.ruanyifeng.com/blog/2016/06 /dns.html
Reference text (CDN (Content Delivery Network) technical principle): http://kb.cnblogs.com/page/121664/
Reference text (a picture illustrating the principle of CDN network): http://blog. csdn.net/coolmeme/article/details/9468743
Reference text (How to build your own CDN server): http://server.zzidc.com/fwqpz/587.html
Reference text (How DNS achieves global load balancing): https:/ /www.zhihu.com/question/29787004
Refer to the original text (the difference and connection between A record, CNAME, MX record, and NS record in domain name resolution) : http://www.2cto.com/net/201306/221200.htmlReference
Original text (A record, CNAME, MX record, NS record in domain name resolution): http://blog.sina.com.cn/s/blog_60b35e830101c2p6.html
Reference original text (DNS domain name resolution for load balancing): http://blog .csdn.net/cywosp/article/details/38017027
Refer to the original text (DNS load balancing and CDN content distribution technology): http://blog.csdn.net/crystal_______/article/details/6929024
Refer to the original text (Introduction to Global Load Balancing and CDN Network) (this is clear): http ://blog.csdn.net/u010340143/article/details/9062213
Refer to the original text (Introduction to Global Load Balancing and CDN Network) (this makes it clear): http://www.ithao123.cn/content-3290025.html

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326771700&siteId=291194637