LXC DNS server

kosta88

Member
Sep 5, 2025
30
6
8
Hello,
I am trying to figure out how this is supposed to work...
I have created an LXC container and set it to DHCP. Nothing under Options except the hostname.
And when I check /etc/resolv.conf in the LXC container (which is Debian13 btw), it doesn't show me what DHCP is delivering.
And even if I set DNS server in Options, it still doesn't use it according to /etc/resolv.conf.

When I go full static, all is fine. It's like LXC containers don't like DHCP, especially when it comes to DNS.

What am I doing wrong?
Thanks
 
Last edited:
Hello,

configuring a LXC with Debian 13 for dhcp should not result in the described behaviour.
Would you like to restart the container with DHCP enabled, run the following command in the container and post the output: journalctl --boot --no-pager _COMM=dhclient
 
I think I know what is going on... while some LXC did work, others did not. Those that did/do not, are actually those created by community scripts. Those need to be left on static, most likely because they were set up as static in the beginning. Maybe I could go about changing this, however that is at this point less important thing... thanks a lot of the answer though.