News: 1684225805

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Alpine Linux 3.18 fixes DNS over TCP issue, now ready for all the internet's problems

(2023/05/16)


The latest update to the ultra-lightweight Alpine Linux distro, as widely used for hosting Docker containers, fixes an important issue.

There are many relatively small new features in [1]Alpine 3.18 , but one of them, while niche, could prove significant. One of several unusual things about Alpine Linux is that it doesn't use glibc , the standard C library that is the basis of almost all other Linux distros. Instead, Alpine is based on the smaller, lighter [2]Musl libc.

For many years, and by design, Musl did not support DNS over TCP, [3]only over UDP .

[4]

This has caused some Alpine users much [5]consternation , and that has led some people to turn [6]against Alpine. Well, no more: DNS over TCP is now [7]supported in Musl 1.2.4, meaning that it also works in Alpine 3.18.

[8]

[9]

Other than being a non-glibc-based distro, Alpine Linux is a member of several minorities among Linux distributions: it's minimalist; it's very lightweight; it's systemd-free; and it still supports x86-32 as a first-class platform, alongside x86-64, plus ARMv7, ARM64, PPC64LE, and S390X. There are native versions for several models of Raspberry Pi, as well as for running in VMs, plus a version for Xen which can run in dom0 , meaning that it can host the hypervisor.

Perhaps the most most unusual aspect is that although Alpine is quite widely used, there's a good chance that many of its users don't realize that they're using it. As we said when we looked at [10]Alpine 3.16 about a year back, Alpine is [11]the default base container for Docker , although you can also choose something more mainstream, such as Ubuntu or Debian.

[12]

Docker's Alpine container [13]image has been downloaded over a billion times. That is quite substantial, although to be fair, the Docker Ubuntu [14]image also has more than a billion downloads. The key difference, though, is size. For example, to go by JFrog's [15]comparison , the default Ubuntu image contains nearly 300 utilities, while Alpine has well under 100, mostly provided by one binary: [16]busybox . The result is a significant size difference. At the time of writing, the minimal Ubuntu 22.04 image is just under [17]30MB , while the Alpine one is [18]3.24MB – well under the 5MB they [19]claim .

[20]An unexpectedly fresh blast from the past, Freespire 9.5 has landed

[21]Ubuntu 23.04 welcomes three more flavors, but hamburger menus leave a bad taste

[22]When it comes to Linux distros, one person's molehill is another's mountain

[23]Sick of GNOME, Snap and Flatpak? You might like Linux Lite, but beware rough edges

That's quite a difference. If you're building containers, there are lots of good reasons to use Ubuntu – it's familiar to lots more people because it's the most widely used distro, with an [24]estimated third of the Linux market. On the other hand, if you're deploying containers on top, it makes less difference, and if it does what you need, using the much smaller Alpine image could save you a lot of space.

As we said last year, The Reg FOSS desk rather likes Alpine. When we looked at [25]Beta 4 of the Haiku OS , we used the same machine: a 2008 Thinkpad W500, with a Core 2 Duo, and maxed out with 8GB of RAM. Although we don't use that machine a lot, Alpine even survived being shrunk and set to dual-boot, which is not something it supports out of the box. Although it's not as fast as Haiku, it's by far the leanest and quickest Linux distro we've tried on that machine.

We updated that installation to 3.17 when we looked at Haiku, and now we've dug the machine out and updated it again. The upgrade to 3.18 went perfectly smoothly. Then, to test out the documentation as much as anything else, we added Network Manager – connecting to a new Wi-Fi network from the command line was not a trivial exercise, but it's all described – then installed AMD Radeon drivers and enabled the machine's discrete GPU. Nothing broke and it works better than ever.

We also did a clean install alongside Windows XP on our geriatric Sony Vaio P, a 32-bit Intel Atom-based VGN-P11Z. Getting the custom partitioning right was significantly complicated, but again, everything worked. It picks up the onboard Wi-Fi, which Alpine 3.17 could not, drives the Poulsbo GPU reasonably well, and uses as little memory with Xfce as [26]the lightweight-by-Debian-standards Raspberry Pi Desktop .

[27]

Alpine Linux remains a tiny gem of a distro. It's a pleasure to see kernel 6.1.28 running quickly and smoothly on an Atom. It's an educational exercise to get it working, but we recommend trying it… especially if you previously had DNS-related problems. ®

Get our [28]Tech Resources



[1] https://alpinelinux.org/posts/Alpine-3.18.0-released.html

[2] https://www.musl-libc.org/

[3] https://twitter.com/RichFelker/status/994629795551031296

[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2ZGNUQWFHu7CxI7MmKPXYvQAAAFY&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0

[5] https://purplecarrot.co.uk/post/2021-09-04-does_alpine-resolve_dns_properly/

[6] https://martinheinz.dev/blog/92

[7] https://www.openwall.com/lists/musl/2023/05/02/1

[8] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44ZGNUQWFHu7CxI7MmKPXYvQAAAFY&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[9] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33ZGNUQWFHu7CxI7MmKPXYvQAAAFY&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0

[10] https://www.theregister.com/2022/05/26/alpine_linux_316_released/

[11] https://www.theregister.com/2017/04/18/docker_linuxkit_moby/

[12] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44ZGNUQWFHu7CxI7MmKPXYvQAAAFY&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[13] https://hub.docker.com/_/alpine

[14] https://hub.docker.com/_/ubuntu

[15] https://jfrog.com/devops-tools/article/why-use-ubuntu-as-a-docker-base-image-when-alpine-exists/

[16] https://busybox.net/

[17] https://hub.docker.com/layers/library/ubuntu/22.04/images/sha256-ca5534a51dd04bbcebe9b23ba05f389466cf0c190f1f8f182d7eea92a9671d00

[18] https://hub.docker.com/layers/library/alpine/3.18.0/images/sha256-c0669ef34cdc14332c0f1ab0c2c01acb91d96014b172f1a76f3a39e63d1f0bda?context=explore

[19] https://hub.docker.com/r/amd64/alpine/

[20] https://www.theregister.com/2023/05/15/freespire-95-breezes-in/

[21] https://www.theregister.com/2023/05/11/ubuntu_2304_new_flavors/

[22] https://www.theregister.com/2023/05/03/linux_distro_hopping/

[23] https://www.theregister.com/2023/04/17/linux_lite_64/

[24] https://truelist.co/blog/linux-statistics/

[25] https://www.theregister.com/2023/01/11/haiku_beta_4/

[26] https://www.theregister.com/2022/07/11/raspberry_pi_desktop_update/

[27] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/oses&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33ZGNUQWFHu7CxI7MmKPXYvQAAAFY&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0

[28] https://whitepapers.theregister.com/



The "so what" portion is missing from the article

JanCeuleers

I'm not an expert, but one reason I'm aware of why DNS over TCP is required is that only over TCP can large DNS replies be handled (such as when looking up TXT records in the context of SPF verifications done by incoming mail servers). Since UDP does not guarantee that segments are transmitted in order, or indeed at all, segmentation of large packets is supported only over TCP. The RFCs say that a DNS query initially made over UDP must be retried over TCP if the reply was too large to fit into a single packet.

Your packets were eaten by the terminator