Skip to content

【求教】请问domain-rules的执行规则问题 #1980

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

Closed
PiggyRan opened this issue Apr 19, 2025 · 4 comments
Closed

【求教】请问domain-rules的执行规则问题 #1980

PiggyRan opened this issue Apr 19, 2025 · 4 comments

Comments

@PiggyRan
Copy link

原因

我用了一些外部的domain-set文件,但是自己也有部分需求,所以又有自己的一些domain规则。比如我从外部下载了几个文件是oversea-domain-list.txt,一个mainland-domain-list.txt。另外我也有几个域名需要放在oversea-domain-list中,但是这几个域名有可能在mainland-domain-list.txt中。
所以这里就有了一点点冲突。

真实场景可能更加复杂,比如还有reject-domain-list.txt之类的。

请教大佬们

domain-rules的执行优先级或者顺序是什么样的。具体问题:

  1. domain-rules是按在conf里的顺序匹配吗?
  2. domain-rules是匹配上第一个之后就不在匹配别的了吗?还是匹配上就执行,不关心其他domain-rules?
  3. 如果domain-rules之间是冲突的呢?比如匹配的一个domain-rules 有"address #"表示不返回ip地址?另外一个rule有"address 1.2.3.4"表示返回ip地址。这会怎么处理?
  4. domain-rules是否有方案匹配表示匹配上之后就忽略后续所有的domain-rules?怎么做?如果没有,能否加上?
@PikuZheng
Copy link
Contributor

严格按conf文件载入顺序,相同规则后边的会覆盖前边的
子域名匹配优先

@PiggyRan
Copy link
Author

严格按conf文件载入顺序,相同规则后边的会覆盖前边的 子域名匹配优先

相同规则后边的会覆盖前边的 ?不执行前面的是吗?比如说如下两个rule

domain-rules /domain:abc.com/ -nftset #4:inet#fw4#direct_ip_set
domain-rules /domain:abc.com/ -nftset #4:inet#fw4#reject_ip_set

abc.com的ip地址会在那个set里?还是两个都会在?

@PikuZheng
Copy link
Contributor

如果想要两个都在,应该写在一行

@PiggyRan
Copy link
Author

如果想要两个都在,应该写在一行

非常感谢!

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

No branches or pull requests

2 participants