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

[Enhancement] routing response should support asis upstream #617

Open
douglarek opened this issue Aug 29, 2024 · 3 comments
Open

[Enhancement] routing response should support asis upstream #617

douglarek opened this issue Aug 29, 2024 · 3 comments

Comments

@douglarek
Copy link
Contributor

douglarek commented Aug 29, 2024

Improvement Suggestion

Consider the following setup:

 routing {
        # According to the request of dns query, decide to use which DNS upstream.
        # Match rules from top to bottom.
        request {
            qname(suffix:corp1.com, suffix:corp2.com, suffix:corp3.com) -> asis
            # fallback is also called default.
            fallback: alidns
        }
        # According to the response of dns query, decide to accept or re-lookup using another DNS upstream.
        # Match rules from top to bottom.
        response {
            # Trusted upstream. Always accept its result.
            upstream(googledns) -> accept
            # Possibly polluted, re-lookup using googledns.
            ip(geoip:private) && !qname(geosite:cn) -> googledns
            # fallback is also called default.
            fallback: accept
        }
    }

These domain names(suffix:corp1.com, suffix:corp2.com, suffix:corp3.com) are internal company domains and will actually follow the response ip(geoip:private) && !qname(geosite:cn) -> googledns, which is normal but unnecessary.

There are two solutions, one is the cumbersome version:

ip(geoip:private) && !qname(geosite:cn, suffix:corp1.com, suffix:corp2.com, suffix:corp3.com) -> googledns

The second one(currently not supported, it's just as described in the issue title):

upstream(asis) -> accept # level=fatal msg="failed to build DNS response routing: failed to parse 'upstream(asis, googledns)': upstream "asis" not found; please define it in "dns.upstream""

Is it possible that asis is an upstream after all since it is considered built-in?

Potential Benefits

More convenient and reasonable.

@dae-prow
Copy link
Contributor

dae-prow bot commented Aug 29, 2024

Thanks for opening this issue!

@Mitsuhaxy
Copy link

asia不是一个固定的upstream,是根据原始dns请求里的目标dns服务器确定的。

@douglarek
Copy link
Contributor Author

asia不是一个固定的upstream,是根据原始dns请求里的目标dns服务器确定的。

Besides the customized ones, the rest are probably as-is, which seems to be fixed as well.

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