Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNS: add clientip for specific nameserver #504

Merged
merged 1 commit into from Dec 11, 2020
Merged

DNS: add clientip for specific nameserver #504

merged 1 commit into from Dec 11, 2020

Conversation

Loyalsoldier
Copy link
Contributor

No description provided.

@Loyalsoldier
Copy link
Contributor Author

Loyalsoldier commented Dec 11, 2020

Now you can add clientIp for every single DNS nameserver, then you get different DNS results from the same DNS nameserver with different clientip like the following:

{
  "dns": {
    "servers": [
      {
        "address": "https://1.1.1.1/dns-query",
        "domains": ["geosite:cn"],
        "expectIPs": ["geoip:cn"],
        "clientIp": "114.114.114.114"
      },
      {
        "address": "https://1.1.1.1/dns-query",
        "domains": ["geosite:geolocation-!cn"]
      }
    ],
    "clientIp": "1.1.1.1"
  }
}

The nameserver without clientip will use the outer clientip value set in DNS level.

ping @Vigilans

@Loyalsoldier Loyalsoldier marked this pull request as draft December 11, 2020 14:58
@Loyalsoldier Loyalsoldier marked this pull request as ready for review December 11, 2020 15:10
@Loyalsoldier Loyalsoldier merged commit 166d1af into v2fly:master Dec 11, 2020
@Loyalsoldier Loyalsoldier deleted the ns-add-clientip branch December 11, 2020 23:15
@kslr
Copy link
Contributor

kslr commented Dec 12, 2020

测试里面没有关于clientip是否有效的部分吧

@Loyalsoldier
Copy link
Contributor Author

测试里面没有关于clientip是否有效的部分吧

这个要怎么测呢 🤔

@CalmLong
Copy link
Contributor

可以看 DNS 是否根据不同的 clientIp 返回不同的 IP

例如 github.com,使用 8.8.8.8 查询

假设测试地点在美国,当 clientIp 为 日本的 IP 时则 8.8.8.8 会返回 github.com 在日本的 IP

@Loyalsoldier
Copy link
Contributor Author

可以看 DNS 是否根据不同的 clientIp 返回不同的 IP

例如 github.com,使用 8.8.8.8 查询

假设测试地点在美国,当 clientIp 为 日本的 IP 时则 8.8.8.8 会返回 github.com 在日本的 IP

欢迎 PR(我是不知道怎么搞

@LazyZhu
Copy link

LazyZhu commented Jan 27, 2021

@Loyalsoldier
这个 PR 没有合并么?

@Loyalsoldier
Copy link
Contributor Author

@Loyalsoldier
这个 PR 没有合并么?

啥?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants