coredns / fallback

The fallback plugin allows sending queries to alternate upstreams based on rcodes returned from the plugin chain.
Apache License 2.0
12 stars 17 forks source link

Feature: Ability to define the Query to send through fallback as the original query #6

Closed fturib closed 6 years ago

fturib commented 6 years ago

Description

As of now, FALLBACK is re-issuing the DNS Query that failed in the plugin chain (based on the returned Code). BUT, it is re-issuing the DNS Query that is transformed (using REWRITE) to fit requirement of the regular remote upstream.

One of the goals of the Fallback is to give-up to our specific upsream, and send to the regular resolvers. That means if possible without the encoded data with REWRITE.

Proposition of change

To keep FALLBACK generic enough and compatible with existing version, I would propose to add an option "ORIGINAL" in the stanza to specify that request for the DNS query.

Syntax would be, adding an option parameter "original" :

{
    fallback [original] RCODE PROXY_PARAMS
}

NOTE: as we reuse the configuration of PROXY_PARAMS, it is more easy/convenient to add the new parameter in front of PROXY_PARAM. We need to make it optional to keep compatibility.

. {
    REWRITE edns0 local 0xffee <mycode>
    proxy . <mySpecificRemoteResolver>
    fallback NXDOMAIN . <anotherSpecificRemoteresolver>
    fallback original REFUSED . 192.168.100.1:53
    log
}
fturib commented 6 years ago

@johnbelamaric , @yuewko , @mparamonau : can you comment on the proposition ?

johnbelamaric commented 6 years ago

I see, so you want to use the original query from the very start of the chain, without any of the various plugins applied? I suppose that's ok, but it should definitely be optional and not the default.

mparamonau commented 6 years ago

From my point of view it's very useful proposition so far as in some cases we don't want to pass (secured) edns data via plain dns as well as the proposed syntax, agree with John according the optionality of the proposed parameter.

fturib commented 6 years ago

Fixed