在配置vpn的路由器上,通过设置网关为dns,实现内外网dns解析分流
ip dhcp pool data
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
dns-server 192.168.1.1
!
!
ip name-server 114.114.114.114 --定义外网dns server
ip name-server 172.16.186.17 --- 定义内网dns server
ip name-server 172.29.12.25
!
ip domain lookup
ip dns view eascs ----定义dns view关联内网dns
dns forwarder 172.16.186.17
dns forwarder 172.29.12.25
ip dns view default ----定义dns默认view关联外网dns
dns forwarder 114.114.114.114
!
ip dns view-list primary
view eascs 10
restrict name-group 1 ---匹配name-list 1的直接用view eascs解析
view default
!
ip dns name-list 1 permit .*.EASCS.COM ----用正则表达式来定义域名后缀
ip dns server view-group primary
ip dns server