others-路由_公网ip

记录一下 ping不通公网ip 的问题


ping不通公网ip

症状

  • 已经确定了有公网ip (确定方法: 确定是否为公网ip) , 也使用了 xxx.com 域名指向公网ip, 但本机却ping不通 域名及公网ip.
    但是外网机子 (非该公网ip下的机子) 却可以 ping同 域名及公网ip.

解决过程

  1. 使用 nslookup 命令查看一下

    1
    2
    3
    4
    5
    6
    7
    λ nslookup xxx.com
    Server: R6300V2-34AF # 显示的竟让是 路由器的ip
    Address: 192.168.2.1

    Non-authoritative answer:
    Name: nas.wilker.cn
    Address: 14.155.115.88
  2. 修改路由器中 DHCP服务器 中的 dns, 手动指定, 具体地址搜索一下所在地区最快的dns. 这里是深圳, 所以指定为

    1
    2
    202.96.134.133
    202.96.128.166
  3. 再使用 nslookup 命令查看一下. (可能会有dns缓存, 要等一下才生效)

    1
    2
    3
    4
    5
    6
    7
    λ nslookup nas.wilker.cn
    Server: ns.szptt.net.cn # 显示为刚指定的 dns 地址, 正确了
    Address: 202.96.134.133

    Non-authoritative answer:
    Name: nas.wilker.cn
    Address: 14.155.115.88

确定是否为公网ip


dns

  • 深圳

    1
    2
    202.96.134.133
    202.96.128.166
  • 广州

    1
    2
    3
    202.96.128.86
    202.96.128.166
    202.96.134.33
  • 梅州

    1
    2
    202.96.128.166
    202.96.128.86