-
-
Notifications
You must be signed in to change notification settings - Fork 601
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
[client, management] Support DNS Labels for Peer Addressing #3252
Conversation
Co-authored-by: Viktor Liu <17948409+lixmal@users.noreply.github.com>
…ecord casting failure
[management] Support Extra DNS Labels for Peer Addressing
|
@hakansa |
records := d.lookupRecords(r) | ||
if len(records) > 0 { | ||
replyMessage.Rcode = dns.RcodeSuccess | ||
replyMessage.Answer = append(replyMessage.Answer, records...) | ||
} else { | ||
replyMessage.Rcode = dns.RcodeNameError |
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.
This change has broken DNS for me.
I don't have DNS server added to netbird, thus netbird can only resolve subdomains of netbird.local
However, netbird sets search domain to netbird.local
, thus any search first comes through netbird embedded DNS
E.g, when I do resolvectl query google.com
, resolved first tries to ask netbird for google.com.netbird.local
.
And there is a bug: in my case netbird can't lookup google.com, and thus returns NXDOMAIN
(RcodeNameError
) error, making systemd-resolved
skip all other DNS servers and return the answer directly:
google.com: resolve call failed: Could not resolve 'google.com', server or network returned error: SERVFAIL
If netbird DNS server is not authoritative (i.e it has no DNS server defined in dashboard), it should instead return RcodeSuccess
with zero records, so that resolved
can continue the search using system DNS server.
The previous code was working, because it was responding with zero records in that case.
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.
...Or I misunderstood the DNS specification?
For now, I have added DNS in netbird dashboard and it works, but it doesn't seem right that system DNS is skipped now
Edit: In systemd-resolved, FallbackDNS only works when there is no other DNS server defined
Adding 1.1.1.1 as global DNS server and removing DNS servers from netbird dashboard have fixed the issue for me, I'm not sure why did it work out of the box on previous netbird version, but it doesn't seem right that netbird tries to handle all DNS by itself when no DNS server is defined in dashboard.
Looks like I have bisected it to the wrong place, but it definitely broken after merging this PR.
Describe your changes
Adding support for extra DNS labels that allow peers to be addressed using user-defined names.
Example:
Multiple peers with the same extra labels will generate grouped DNS labels on the client side, and this feature can be used for DNS round-robing load balancing.
Issue ticket number and link
Checklist