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

plugin/azure return FQDN as MNAME in SOA record #4286

Merged
merged 1 commit into from
Nov 12, 2020

Conversation

mancaus
Copy link
Contributor

@mancaus mancaus commented Nov 12, 2020

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

@codecov-io
Copy link

Codecov Report

Merging #4286 (577f8dd) into master (2299c5b) will decrease coverage by 0.02%.
The diff coverage is 16.66%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
plugin/azure/azure.go 10.58% <16.66%> (-0.23%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2299c5b...577f8dd. Read the comment docs.

@@ -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)
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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...

Copy link
Contributor Author

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 

@miekg
Copy link
Member

miekg commented Nov 12, 2020 via email

Signed-off-by: Blake Ryan <blake.ryan@dunnhumby.com>
@mancaus
Copy link
Contributor Author

mancaus commented Nov 12, 2020

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.

@miekg
Copy link
Member

miekg commented Nov 12, 2020 via email

Copy link

@corbot corbot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by miekg

@corbot corbot bot merged commit c9c71d3 into coredns:master Nov 12, 2020
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.

4 participants