-
Notifications
You must be signed in to change notification settings - Fork 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
No DNS Search Domain support in Alpine Linux image due to muslc #602
Comments
Is this actionable for us? Or is it a bug with node and musl? |
Perhaps not but this kind of issue should be tracked for a case to the broader node community for official support of Alpine Linux. |
See nodejs/node#17850. I'd say this can be closed because it's not an issue with alpine, musl or docker - |
@bnoordhuis If you look at the Node.js DNS test repository I created, lookup does work and resolve doesn't: https://github.com/Mickael-van-der-Beek/node-dns-test If you then run the syscall in C directly, you will see that there is in fact a difference between Debian and Alpine Linux for the same source code: |
Sorry, typo in my comment - I meant
Can you summarize the differences? |
If you do a If we inspect both containers, the docker compose utility sets up this
Which looks fine. The only difference is that in the Debian case we use:
and in the Alpine Linux case:
From the issue thread below, you can see that the feature was supposedly implemented in In that sense it's not a Node.js issue, just an Alpine Linux issue but it's still interesting to document the issue for posterity. |
@bnoordhuis Just to clarify, the issue I described above is valid for the |
Ah, I get it now. That's a documented difference with glibc: musl ignores search/domain for names with dots >= ndots. Since 0 >= 0, it's always going to do a regular lookup. With Is that |
@bnoordhuis That seems to indeed be the default value in Docker based on libnetwork: https://github.com/docker/libnetwork/blob/19ac3ea7f52bb46e0eb10669756cdae0c441a5b1/resolver.go#L204 |
I'm trying to make requests from an alpine node container to another container and running into dns issue |
I get the same |
Closing as an Alpine/Docker issue |
It seems like
dns.lookup()
calls will not work in Node.js's Alpine Linux image versions when search domains are used.Calls like
dns.resolve()
won't work for a different reason which is C-Ares having issues with the feature.Alpine Linux uses
musl libc
instead ofgnu libc
, the former didn't support search domains until version 1.1.13. It seems though that even on more recent versions ofmusl libc
, the bug persists.cf: https://wiki.musl-libc.org/functional-differences-from-glibc.html#Name_Resolver_.2F_DNS
cf: gliderlabs/docker-alpine#8
To make reproduction of this issue easier, I created a repository with one Debian and one Alpine Dockerfile that you can find here:
https://github.com/Mickael-van-der-Beek/c-dns-test
Edit: Might also be related to mhart/alpine-node#107
The text was updated successfully, but these errors were encountered: