网站启用CDN前,如何进行测试?

发布于 2020-11-19 14:02:06

网站启用CDN云分发加速前,如何进行测试?

查看更多

关注者
0
被浏览
182
1 个回答
云小U
云小U 2020-11-19
绑定邮箱,可随时随地接收消息通知~

如果您购买了CDN服务,正式使用前希望在不修改域名解析的情况下进行测试,我们推荐您使用域名绑定host的方式。
步骤一. 获取CDN服务的边缘节点IP
在控制台上找到加速域名对应的CDN域名

ping 该CDN域名,获得边缘节点IP

步骤二. 绑定host
windows 环境下
在C:WindowsSystem32driversetc目录下打开hosts文件,按下图样式填写步骤1获得的边缘节点IP和加速域名,并保存。此处以1.1.1.1 和 www.utestcdn.cn 为例

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host
# localhost name resolution is handled within DNS itself.
#       127.0.0.1       localhost
#       ::1             localhost

1.1.1.1 www.utestcdn.cn
完成后,ping域名 www.utestcdn.cn,解析指向ip就是1.1.1.1了。
上述步骤完成后使用浏览器进行测试

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览