NixOS Networking | 900 Members | |
| Declaratively manage your switching, routing, wireless, tunneling and more. | 270 Servers |
| Sender | Message | Time |
|---|---|---|
| 5 Apr 2026 | ||
| * You can use the | 01:22:26 | |
| * You can use the | 01:23:38 | |
| * You can use the | 01:24:05 | |
Ugh, I have spent way too long debugging why ipv6 scope IDs were not present when resolving nspawn containers from the host. It looks like nss-mymachines is broken? I would need someone else to try getent -s hosts:mymachines hosts example | 02:38:37 | |
| empty | 02:44:02 | |
| on the one machine I have with a nixos container | 02:44:08 | |
| if that's what you were looking for | 02:44:16 | |
| Yep. Damn. And is that set up with a .nspawn file? | 02:46:41 | |
| or maybe that's only for nspawn? | 02:46:46 | |
| hm | 02:46:49 | |
| whatever the current generation of nixos containers is | 02:47:04 | |
| Well if it comes up in "machinectl" and it has a ve-$container interface on the host, it should give you something based on my understanding | 02:47:49 | |
| it does come up in machinectl | 02:48:01 | |
| getent hosts <container> works fwiw | 02:49:48 | |
| Does your container have more than just link local ips? | 02:50:14 | |
In reply to @hexa:lossy.networkWorks for me too but on ipv6 returns no scope ID for link local addresses | 02:50:43 | |
| I believe it is using llmnr-ipv6 instead in this case. I was able to validate that with `resolvectl query -p llmnr-ipv6 example` | 02:51:56 | |
| nvm, no interface in the host namespace | 02:52:26 | |
| it has a bunch of ULA ip addresses | 02:52:41 | |
| eh … 5am | 02:53:05 | |
| 💤 | 02:53:08 | |
| Yeah, early here too. Ttyl if you are around but thanks for the quick checks | 02:53:58 | |
| Just for sanity: the docs on mymachines demonstrate clearly that an ipv6 ping should return a scope ID https://www.freedesktop.org/software/systemd/man/latest/nss-mymachines.html | 03:00:55 | |
A couple of straces later, I've found that libnss_mymachines.so.2 isn't in the standard library path. Adding it via LD_LIBRARY_PATH makes getent ahosts work as expected. Uh, this is where my nixos knowledge is not great - what's the right way to make this library available for the whole system? It's always dynamically loaded based on nsswitch.conf, so I can't compile it in to the necessary binaries. | 10:35:05 | |
| Another person has walked this path before 😅 systemd/lib is in nscd.service's LD_LIBRARY_PATH, and nscd.conf has an interesting note:
| 10:40:43 | |
| But this still doesn't explain why ping is not getting the result from mymachines. Perhaps nscd doesn't have permission to send the dbus message to systemd to get the container addresses? | 10:45:36 | |
| It does have perms, stracing nscd proves the same output. But somewhere between nscd getting a response from mymachines/getaddrinfo and responding to the requesting client, the scope_id is lost | 11:59:44 | |
| * It does have perms, stracing nscd proves the same output. But somewhere between nscd getting a response from mymachines and responding to the requesting client, the scope_id is lost | 12:01:38 | |
| nsncd/nscd just doesn't support scope IDs, and that's the end of the story. nss-mymachines is working fine, but with the way nixos is configured you would have to make sure libsystemd is in the LD_LIBRARY_PATH for all processes that need to do lookups. I can achieve that in my case, but it's awkward. Would be much nicer if systemd-resolved or some other tool could be a better replacement here | 17:50:29 | |
| that's kinda why I query the machines via some mechanism and nsupdate this into an authoritative dns server fwiw. | 17:55:37 | |