Skip to content

Full VM images have leftover resolv.conf, don't use systemd-resolved #331

@scottyeager

Description

@scottyeager

Checking the Ubuntu full VM images (24.04 and 22.04) I notice that there's a resolv.conf written during image build:

https://github.com/threefoldtech/tf-images/blob/1a045e86c904b737cedf656cc8200fd76abec852/tfgrid3/ubuntu24.04/fullvm/ubuntu24-fullvm-flist-builder.sh#L30

This I would expect to be temporary, but in fact it is not cleaned up. So apps using resolv.conf inside deployed VMs will go directly to 1.1.1.1 and that server only.

On the other hand, systemd-resolved is already running when these images are deployed, and using it would be the normal thing to do in an Ubuntu machine. There are various advantages to using resolved and no obvious downside.

To change it, these lines would be added to the image build script, after all steps requiring DNS have been completed:

rm /etc/resolv.conf
ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions