Skip to content

DNS hosts: Support returning RCode #4681

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

Merged
merged 3 commits into from
Jul 23, 2025
Merged

DNS hosts: Support returning RCode #4681

merged 3 commits into from
Jul 23, 2025

Conversation

j2rong4cn
Copy link
Contributor

@j2rong4cn j2rong4cn commented May 1, 2025

返回指定RCode: https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-6
示例:

{
  "dns": {
    "hosts": {
      "geosite:category-ads-all": "#3"
    }
  }
}

@patterniha
Copy link
Contributor

@j2rong4cn

when rcode=0, instead of RCodeError(0) it should return dns.EmptyResponse

and in other cases you should return:

errors.New("returning nil for domain ", domain).Base(err) instead of err.

@patterniha
Copy link
Contributor

patterniha commented May 1, 2025

change "dns.go" instead to cover "errors.New("returning nil for domain ", domain).Base(err)" too.

@j2rong4cn
Copy link
Contributor Author

j2rong4cn commented May 1, 2025

@j2rong4cn

when rcode=0, instead of RCodeError(0) it should return dns.EmptyResponse

and in other cases you should return:

errors.New("returning nil for domain ", domain).Base(err) instead of err.

Thanks for the review, any other questions?

@patterniha
Copy link
Contributor

change your codes base on #4702

The matched-results are appended again.

Give "#" the highest priority, meaning if one result is "#", other results will be omitted.(you should change "lookupInternal" function)

@j2rong4cn
Copy link
Contributor Author

change your codes base on #4702

The matched-results are appended again.

Give "#" the highest priority, meaning if one result is "#", other results will be omitted.(you should change "lookupInternal" function)

我提交新代码了,你看一下对不对?

@patterniha
Copy link
Contributor

patterniha commented May 9, 2025

In my opinion it is ok and can be merged.
But I am not the decision maker, my PRs haven't been merged yet.

@patterniha
Copy link
Contributor

@j2rong4cn

LookupHosts function is removed from dns.go, change your code to resolve conflicts.

@RPRX
Copy link
Member

RPRX commented Jun 6, 2025

需要 rebase,功能太小众,放下个版本

@patterniha
Copy link
Contributor

@j2rong4cn ?

@patterniha
Copy link
Contributor

@RPRX

ready to merge.

@RPRX
Copy link
Member

RPRX commented Jun 9, 2025

DNS 最近的 new features 在下个版本可能会有变动,比如 #4666 我合并前没看,前面讨论了什么也忘了,参数可能会重新设计

@patterniha
Copy link
Contributor

patterniha commented Jun 9, 2025

DNS's recent new features may change in the next version. For example, I didn't read #4666 before merging it, and I forgot what was discussed before. The parameters may be redesigned.

@RPRX

my serverless-config is almost ready, If I publish it and then make changes again, many users will be confused. The features are very simple, If possible, finalize it sooner.

@RPRX
Copy link
Member

RPRX commented Jun 9, 2025

@patterniha 即使现在 finalize 了,近期也不会再发版了,即使以后参数改了,新旧参数都填上应该就行了

@patterniha
Copy link
Contributor

@RPRX

The problems solved in these PRs(I found them) are important and should be fixed in the new version:

#4899: fix UDP dispatcher cause close connection frequently problem
#4869: fix reverse problems
#4861: fix MUX.cool problems
#4816 and #4804: fix freedom-UDP problems

I checked them all and they are OK, also @Fangliding created/approved them.

also this PR extends the features of DNS-host and It is OK too.

@patterniha
Copy link
Contributor

patterniha commented Jul 19, 2025

@RPRX

Can you spare some time for my PRs?

I spent a lot of time to finding and fixing these bugs, please review them.

fang close my new PRs because I have many open PRs instead of giving the right reason !!!

@RPRX
Copy link
Member

RPRX commented Jul 21, 2025

@patterniha 你们的 PR 会在新版本前被合并

@RPRX RPRX changed the title DNS hosts: Support return RCode DNS hosts: Support returning RCode Jul 23, 2025
@RPRX RPRX merged commit 923b5d7 into XTLS:main Jul 23, 2025
39 checks passed
@j2rong4cn j2rong4cn deleted the dns-hosts branch July 26, 2025 13:09
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.

3 participants