一、cdn概念及原理
CDN(Content Delivery Network),即内容分发网络,在网络各处放置节点服务器所构成的在现有互联网基础之上的一层智能虚拟网络。cdn系统可实时的根据网络流量和各节点的连接,负载情况以及到用户的距离和相应时间等综合信息将用户的请求重新导向离用户最近的服务节点上。
工作原理如图:
二、实现智能DNS的相关配置
1.DNS主服务端配置
- 修改/etc/named.conf
acl beijingnet { 10.0.0.0/24; 11.0.0.0/24; }; acl shanghainet { 172.16.0.0/24; }; view beijingview { match-clients { beijingnet;}; include "/etc/named.rfc1912.zones.bj"; }; view shanghaiview { match-clients { shanghainet;}; include "/etc/named.rfc1912.zones.sh"; }; zone "." IN { type hint; file "named.ca"; };
- 修改/etc/named.rfc1912.zones,将/etc/named.rfc1912.zones用cp -p命令带权限拷贝为/etc/named.rfc1912.zones.bj和/etc/named.rfc1912.zones.sh,并修改这两个区域配置文件,
zone "." IN { type hint; file "named.ca"; }; zone "magedu.org" { type master; file "codeammon.com.zone.bj"; }; zone "magedu.org" { type master; file "codeammon.com.zone.sh"; };
- 创建区域数据库文件并修改
cp -p /var/named/codeammon.com.zone /var/named/codeammon.com.zone.bj cp -p /var/named/codeammon.com.zone /var/named/codeammon.com.zone.sh $TTL 1D @ IN SOA master 123456.qq.com. ( 0 ; serial 1D ; refresh 1H ; retry 1W ; expire 3H ) ; minimum NS master NS slave shenzhen NS szdns master A 10.0.0.153 slave A 10.0.0.156 beijing A 10.0.0.150 www CNAME beijing $TTL 1D @ IN SOA master 123456.qq.com. ( 0 ; serial 1D ; refresh 1H ; retry 1W ; expire 3H ) ; minimum NS master NS slave shenzhen NS szdns master A 10.0.0.153 slave A 10.0.0.156 shanghai A 172.16.0.150 www CNAME shanghai
- 搭建web服务器,和DNS客户端,测试,参考博文
dig www.codeammon.com @10.0.0.153 dig www.codeammon.com @1172.16.0.100
在学习中进步,如有错误,请多多批评指正
原文链接:https://blog.csdn.net/qq_41779533/article/details/122443526?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522165934461816782388051197%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=165934461816782388051197&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~blog~first_rank_ecpm_v1~times_rank-3-122443526-null-null.article_score_rank_blog&utm_term=%E6%90%AD%E5%BB%BAcdn
原创文章,作者:优速盾-小U,如若转载,请注明出处:https://www.cdnb.net/bbs/archives/5843