前些天集团的财务反应无法使用“广东省地方税务局电子办税服务厅“,经排查发现使用公司的网络无法正常打开地税网站,但电脑改使用另一个宽带线路或手机移动数据连接上网,可正常打开地税网站。
通过使用http://www.webkaka.com/dns/ 网络检测平台,检测到www.gdltax.gov.cn使用了cdn加速,不同地区或网络的用户会给解析到不同的ip。检测结果看到www.gdltax.gov.cn使用的cdn IP有四个219.135.197.120(广东省广州市从化市 电信)、61.142.246.130(广东省佛山市 电信)、183.237.50.154(广东省 移动)、210.21.89.7(广东省广州市 联通),实际cdn 的ip数量可能不止四个节点,公司访问会解析到219.135.197.120这个ip。
windows下获取节点IP
测试节点文件是否正常
通过curl工具,测试该节点资源是否正常
linux下自带curl工具--注意,-x后面跟着的是节点IP加上:端口,http默认为80
[root@backup~]# curl -i http://www.gdltax.gov.cn -x 183.237.50.154:80
HTTP/1.1 302 Found
Date: Thu, 18 Jan 2018 01:15:18 GMT
Server: Apache
Location: http://www.gdltax.gov.cn/gdsite/index.shtml
Vary: Accept-Encoding
Content-Length: 227
Content-Type: text/html; charset=iso-8859-1
Connection: Keep-alive
Via: 1.1 ID-0002262071213052 uproxy-2
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="http://www.gdltax.gov.cn/gdsite/index.shtml">here</a>.</p>
</body></html>
[root@backup~]# curl -i http://www.gdltax.gov.cn -x 210.21.89.7:80
HTTP/1.1 302 Found
Date: Thu, 18 Jan 2018 01:13:41 GMT
Server: Apache
Location: http://www.gdltax.gov.cn/gdsite/index.shtml
Vary: Accept-Encoding
Content-Length: 227
Content-Type: text/html; charset=iso-8859-1
Connection: Keep-alive
Via: 1.1 ID-0002262071212470 uproxy-8
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="http://www.gdltax.gov.cn/gdsite/index.shtml">here</a>.</p>
</body></html>
[root@backup~]# curl -i http://www.gdltax.gov.cn -x 61.142.246.130:80
curl: (7) Failed connect to 61.142.246.130:80; Connection refused
[root@backup~]# curl -i http://www.gdltax.gov.cn -x 219.135.197.120:80
可以看到后面两个ip无法正常访问。
win的用户可以打开C:\Windows\System32\drivers\etc ,直接记事本修改hosts文件,有些电脑因为权限问题可能要把hosts文件复制到桌面修改后再覆盖原文件。
添加
183.237.50.154 www.gdltax.gov.cn
或
58.252.106.227 www.gdltax.gov.cn
保存,IE打开网站,看到页面正常。
因为使用集团内部使用地税网站的人不多,所以就不通过修改内部dns服务的方式去解决这个问题,直接给相关人员修改本机hosts文件。
其它网站url如果是使用cdn技术也可参照这个步骤处理。