Can't resolve using custom nsswitch.conf items
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
The host /etc/nsswitch.conf is not being honored inside the snap container leading to .docker (or using my custom plugin .lxd) hosts not being resolved.
How to reproduce:
1. Run a docker host name 'test' with a http server in it.
2. Install libnss-docker.
3. ping test.docker and see that it works.
4. Open snap firefox.
5. Access http://
Another way to reproduce:
1. Create a lxd container named 'test' with a http server in it.
2. Download and install: https:/
3. Ping test.lxd and see that it works.
4. Open snap firefox.
5. Access http://
I'm not sure how to be able to resolve this since the binary is in the host? Perhaps systemd-resolved's dnsmasq can be coaxed to use /etc/nsswitch.conf and the container's be coaxed to use the hosts :53 dns?
ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: snapd 2.54.3+
Uname: Linux 5.16.1-xanmod1 x86_64
ApportVersion: 2.20.11-0ubuntu78
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: ubuntu:GNOME
Date: Mon Mar 7 14:05:09 2022
EcryptfsInUse: Yes
InstallationDate: Installed on 2018-10-03 (1251 days ago)
InstallationMedia: Ubuntu 18.04.1 LTS "Bionic Beaver" - Release amd64 (20180725)
SourcePackage: snapd
UpgradeStatus: No upgrade log present (probably fresh install)
The alternative way to make it work is to have /etc/resolv.conf point to a local dnsmasq instance that has: server= /lxd/10. 45.148. 1@lxdbr0 in it. Where 10.45.148.1 is where lxd's dnsmasq is listening too.