Live data from Hacker News

DNS resolution issue in Alpine Linux (2021)

christoph.luppri.ch

41–50 of 61 posts

Re: DNS resolution issue in Alpine Linux (2021)

#42
post #23

Earlier quoted context omitted.

There isn't anything weird, I went on #musl asked the question, the functionality is desired but it should be worked with the community to ensure correctness.

Yes, there is. I'm not just making this up. I've gotten takes from "musl people", including Rich Felker, that this was a deliberate choice, and that not only is musl's behavior of pretending that truncated UDP responses are valid acceptable, but that it's somehow better (maybe for performance?) --- that you can always serve "getaddrinfo" off of just the truncated UDP result. Which is, of course, false. There is a wei…

> There is a weird thing going on

It's not weird they're just incompetent / a bozo.

Re: DNS resolution issue in Alpine Linux (2021)

#43

Earlier quoted context omitted.

If you care about image size you need to switch to a distroless image base. It's incredibly easy nowadays with multi-stage builds. IMHO people use alpine not because they seek it out but because they're reading old guides and advice that hasn't been updated with the times. Blindly switching to alpine to save space is opening yourself up to exactly these sorts of musl-libc quirks and issues--you better have solid test…

There are a lot of tools that simply can't run distroless and adding in all the requirements is often tedious with little reward.

What are some of the tools that can't run on distroless?

Re: DNS resolution issue in Alpine Linux (2021)

#44
DNS in Alpine is notoriously buggy but it can get months until you realise that. One easy and effective solution is to force dns resolution like so

dnsConfig: options: - name: ndots value: '1'

cc: https://support.cloudbees.com/hc/en-us/articles/360040999471...

There are also plenty of dormant issue, enough so that I won't be using Alpine ever again imo :'(

Re: DNS resolution issue in Alpine Linux (2021)

#45
post #37

Few days ago, I spent quite a few hours trying to make `apk update` work for alpine on WSL2 on Windows. It didn't want to resolve dl-cdn.alpinelinux.org within alpine. Did resolve on host ubuntu. 1. WFH from VPN, firstly I had to lower mtu from 1500 to 1392 (My VPN specific issue) https://github.com/microsoft/WSL/issues/4698 2. Next, I had to run some powershell script that updates /etc/resolv.conf to use my VPN DNS…

Is DNS set in /etc/docker/daemon.json?

Re: DNS resolution issue in Alpine Linux (2021)

#46
> [...] the standard was extended by two options:

> - Increasing the size of the UPD packet above 512 bytes via the Extension Mechanism for DNS (EDNS)

> - Switching the protocol from UDP to TCP

> Alpine Linux, or rather musl libc, doesn’t support either of those options.

It still seems weird to me that such details are decided by libc. My reflex idea when designing a system would be to put DNS functionality in a system service, while libraries would only query the service, without troubling themselves with system caches, TCP vs UDP etc. Then possibly the service could be even swapped for another with a compatible interface, but making different decisions, without perturbing the applications. It sounds like systemd-resolved is a move in that direction, but I still don't understand why putting all that in libc, essentially making all applications perform their own independent DNS work, was the original choice.

Re: DNS resolution issue in Alpine Linux (2021)

#49

Earlier quoted context omitted.

"you're on your own" is like, the expected thing when you are doing something different. Still, Alpine is on top of everyone else when it comes to Docker Images sizes. Thats why it will stick.

If you care about image size you need to switch to a distroless image base. It's incredibly easy nowadays with multi-stage builds. IMHO people use alpine not because they seek it out but because they're reading old guides and advice that hasn't been updated with the times. Blindly switching to alpine to save space is opening yourself up to exactly these sorts of musl-libc quirks and issues--you better have solid test…

I would suggest to just use a small number of base images. The total size of all layerse is irrelevant in most cases if it's a small layer on top of something common for you = cached.

Re: DNS resolution issue in Alpine Linux (2021)

#50
In my experience, the storage, bandwidth and time savings using Alpine Linux (even if they were much more significant than they are in practice) are not worth it given the issues you run into every once in a while. Just go with Ubuntu/Debian base images and you'll be much happier that you did in the long run.
Post reply on HN