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

Add DNS outbound to hijack DNS packets #1078

Merged
merged 4 commits into from
Mar 4, 2024
Merged

Add DNS outbound to hijack DNS packets #1078

merged 4 commits into from
Mar 4, 2024

Conversation

sduoduo233
Copy link

dns:
  enable: true
  default-nameserver:
    - 223.5.5.5
  nameserver:
    - tls://dns.google#Proxy
  proxy-server-nameserver:
    - tcp://8.8.8.8

rules:
  - AND,((NETWORK,udp),(DST-PORT,53)),DNS
  - MATCH,Proxy

上面的配置会把所有 53 端口的 UDP 包转到内置的 DNS 服务器。用 TPROXY 的时候就不用自己配置 iptables 来劫持 DNS了。

@Skyxim
Copy link
Collaborator

Skyxim commented Mar 3, 2024

应该暴露出配置,而非硬编码且默认开启,会占用 DNS 这个名字且他人无法修改,而且存在有使用这个名但是不为劫持使用的

@sduoduo233
Copy link
Author

应该暴露出配置,而非硬编码且默认开启,会占用 DNS 这个名字且他人无法修改,而且存在有使用这个名但是不为劫持使用的

你的意思是这样吗

dns:
  enable: true
  default-nameserver:
    - 223.5.5.5
  nameserver:
    - tls://dns.google#Proxy
  proxy-server-nameserver:
    - tcp://8.8.8.8
  hijack-dns: true

rules:
  - AND,((NETWORK,udp),(DST-PORT,53)),DNS
  - MATCH,Proxy

只有 hijack-dns: true 的时候才有 DNS 这个出站

@Skyxim
Copy link
Collaborator

Skyxim commented Mar 3, 2024

由于这是个出站应该存在

- name: dns-hijack
  type: dns

而非直接使用,这个不是一个必要的代理,别写太固定

@sduoduo233
Copy link
Author

改完了

proxies:
  - name: "DNS Hijack"
    type: dns

rules:
  - AND,((NETWORK,udp),(DST-PORT,53)),DNS Hijack
  - MATCH,Proxy

@wwqgtxx wwqgtxx merged commit 3ec23c1 into MetaCubeX:Alpha Mar 4, 2024
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

5 participants