公司在微信WIFI登陆项目中,须要在BRAS设备上添加微信服务器的IP地址到白名单列表中,以实现用户链接热点后,可以使用微信中的功能(如:添加公众号),但不能使用其余应用进行上网操做。后经查询资料发现可经过腾讯提供的一个接口获取微信服务器IP列表,win10的edge浏览器能够正常浏览,部分其余浏览器没法正常浏览。linux
接口地址:http://dns.weixin.qq.com/cgi-bin/micromsg-bin/newgetdns浏览器
网页浏览效果:服务器
在linux下可经过以下脚本定时获取IP列表进行累计更新:微信
curl --compressed -s http://dns.weixin.qq.com/cgi-bin/micromsg-bin/newgetdns | grep "</ip>" | sed "s/<ip>//" | sed "s/<\/ip>//"|grep -v "127.0.0.1" |sort|uniq >t1.txt cat ip.txt >> t1.txt cat t1.txt|sort|uniq > ip.txt