-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ndots behavior seems wrong #1198
Comments
can add a test that show explicitly what you expect. note we already countlabel ones in this function, we shouldn't do it twice |
we should also update the doc string |
What does the netgo resolver in the standard library (package net) do? |
which has the same logic than this lib Go can use the internal go resolver or libc/musl on the host. Test Setup
Using netgo resolverResolving
tcpdump when using netgo resolver
Using libc resolverResolving
tcpdump when using libc resolver
Using nslookup with libc
Using dig with libc
Conclusion
Source https://man7.org/linux/man-pages/man5/resolv.conf.5.html I would say I think we can close this issue based on the |
@rewiko Thank you for that investigation. I agree that it seems like we’re doing the right thing here. I suspect dig and nslookup differ as they’re more utility tools. |
[ Quoting <notifications@github.com> in "Re: [miekg/dns] ndots behavior seem..." ]
Closed #1198.
We probably still want to change the doc-string for this function though...
|
Hi,
I have been using this library to resolve
kubernetes.default
with ndots config set to 1, and I was expecting to get a NXDOMAIN response but I actually got a NOERROR because this function seems to append the search domain even if the ndots is set to 1 and the hostname contains 1 dots.I have tested the behavior with
nslookup
,dig
and host on alpine (musl) and ubuntu (libc) and they all honor the ndots and does not append the search domain.I think it would make sense to have
To do not append search domain when the number of dots in the hostname is greater than the ndots config.
The text was updated successfully, but these errors were encountered: