-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
plugin/azure return FQDN as MNAME in SOA record #4286
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4286 +/- ##
==========================================
- Coverage 56.10% 56.08% -0.03%
==========================================
Files 224 224
Lines 9917 9921 +4
==========================================
Hits 5564 5564
- Misses 3892 3895 +3
- Partials 461 462 +1
Continue to review full report at Codecov.
|
plugin/azure/azure.go
Outdated
@@ -346,7 +346,14 @@ func (h *Azure) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) | |||
return dns.RcodeServerFailure, nil | |||
} | |||
|
|||
w.WriteMsg(m) | |||
err := w.WriteMsg(m) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't really care if this fails, there's nothing what we can do about, logging it will allows for easy DoS-ing of whatever these logs end up in. Please remove.
original change lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, and good point - will do. Just to check - should we log as Debug? I only ask because the logs that were written gave the impression that a response was returned to the client, when it wasn't.
I'm happy either way and will adjust the PR once you can confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, true point. We can save the err and return it from the plugin, then it will be logged by errors plugin, but that would be a system wide change.
Apart from we can't pack a message because of an issue like this, failing a write to a client is not important. We could check for dns: type errors and only log those...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what you propose makes sense - just return any error directly without logging. I just tried that and, as you say, it causes the errors plugin to pick it up and I see a reasonable log entry:
[ERROR] plugin/errors: 2 shop-job-adapter.sxdb-blake-dev-neu.azdevint.dh. AAAA: dns: domain must be fully qualified
[ Quoting <notifications@github.com> in "Re: [coredns/coredns] plugin/azure ..." ]
@mancaus commented on this pull request.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
In plugin/azure/azure.go:
> @@ -346,7 +346,14 @@ func (h *Azure) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
return dns.RcodeServerFailure, nil
}
- w.WriteMsg(m)
+ err := w.WriteMsg(m)
I think what you propose makes sense - just return any error directly without
logging. I just tried that and, as you say, it causes the errors plugin to pick
it up and I see a reasonable log entry:
[ERROR] plugin/errors: 2 shop-job-adapter.sxdb-blake-dev-neu.azdevint.dh. AAAA: dns: domain must be fully qualified
yep. But this is an exception as this is a coding error in coredns, generally we don't
care about the WriteMsg error, this with rogue clients this becomes usefully wasteful.
An no matter what: this needs to be done in a different PR/issue anyway (and I'm not a
proponent of it for the reasons explained here)
/Miek
…--
Miek Gieben
|
Signed-off-by: Blake Ryan <blake.ryan@dunnhumby.com>
Thanks @miekg - this latest change to the PR reverts the error checking, so the change is back to the one-line fix for the issue itself. |
/lgtm
/merge
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved by miekg
1. Why is this pull request needed and what does it do?
See #4285 - adds error handling for failure to send DNS response and ensures SOA host is an FQDN, as Azure private zones return a DNS name here currently.
2. Which issues (if any) are related?
#4285
3. Which documentation changes (if any) need to be made?
None
4. Does this introduce a backward incompatible change or deprecation?
No