LXC (Ubuntu/Debian) with systemd-resolved's /etc/resolv.conf and adding DNS info?


Active Member
May 21, 2013
Good day,

I got the need to fix the DNS query flooding and to deploy systemd-resolved, BUT that means I need to find a different way to inject the LXC's search domains and DNS server. I know what I all have to modify/change, but before I go on that endeavour, I'm wondering what others are doing, as I hoped that there is/was a method to keep the addition of the DNS server and search domains from the PVE side as/when/where I create the containers, but that it doesn't overwrite/re-create the /etc/resolv.conf but have the information written in a different place for systemd-resolved to get it's configuration to use those paramters.

The method I (so far small scale by hand) had done:
  1. touch /etc/.pve-ignore.resolv.conf
  2. rm /etc/resolv.conf
  3. ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
  4. vi /etc/systemd/resolved.conf -> adding the DNS server etc.



The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!