naiveproxy icon indicating copy to clipboard operation
naiveproxy copied to clipboard

关于host-resolver-rules使用

Open Demon-Cat opened this issue 5 years ago • 1 comments

第一种方式,普通的配置方式:

{
  "listen": "socks://127.0.0.1:1080",
  "proxy": "https://user:[email protected]"
}

第二种方式:将域名静态解析为 IP 地址。

{
   "listen": "socks://0.0.0.0:1080",
   "host-resolver-rules": "MAP example.com NAT_IP:NAT_PORT", 
   "proxy": "https://user:[email protected]"
}

有时我可能因某些需求使用第二种,请问第一种方式和第二种方式哪种比较安全些?如果采取第二种配置,可以实现iptables中转流量,相反第一种则不能。host-resolver-rules看说明是将域名静态解析为 IP 地址,如果采取第一种配置,最终也是将example.com解析为IP还是?我想了解其第二种的运作方式,作者能否指点下?

如果采取第二种,流量中转过程会不会被其他恶意劫持解析?

以上则是我要了解的内容了。

Demon-Cat avatar Oct 05 '21 12:10 Demon-Cat

host-resolver-rules跟在/etc/hosts里面添加一行的效果是等价的,只是修改配置不需要sudo。

从这个出发,后续的问题可以自己解答一下。

klzgrad avatar Oct 06 '21 06:10 klzgrad