Skip to content

DNS规则动作predefined的answer能否配置只返回IP? #3003

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
CC-3301 opened this issue May 18, 2025 · 1 comment
Closed

DNS规则动作predefined的answer能否配置只返回IP? #3003

CC-3301 opened this issue May 18, 2025 · 1 comment
Labels
from end user An end user is asking a developer to fix their problem for free invalid This doesn't seem right

Comments

@CC-3301
Copy link

CC-3301 commented May 18, 2025

目前用DNS规则来拦截广告域名,如果直接返回NXDOMAIN,有些域名还是会一直疯狂请求,浪费移动设备电量

用Pi-hole同款方案NOERROR+0.0.0.0倒是可以正常拦截,但是answer配置不了只返回IP,只能配置为
{
"rule_set": "geosite-reject",
"action": "predefined",
"rcode": "NOERROR",
"answer": "localhost. IN A 0.0.0.0"
}

如果直接填写 "answer": "0.0.0.0" 则会报错dns.rules[1].answer: (dns: not a TTL: "0.0.0.0" at line: 1:7 | json: cannot unmarshal string into Go value of type []option.DNSRecordOptions)

@nunu6689
Copy link

You need to write the answer correctly with ttl. localhost. 60 IN A 0.0.0.0

@nekohasekai nekohasekai added invalid This doesn't seem right from end user An end user is asking a developer to fix their problem for free labels May 23, 2025
@nekohasekai nekohasekai closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from end user An end user is asking a developer to fix their problem for free invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants