Bug in resolv.conf using containers

joverdijk

New Member
Jul 7, 2018
7
0
1
46
Hi

It seems like i'm getting some kind of buggy behaviour inside debian9 container.

resolv.conf gets rewritten with wrong info, the searchdomain contains first dns-server instead of the actual search-domain :

root@debian1:~# cat /etc/resolv.conf
# --- BEGIN PVE ---
search 8.8.8.8
nameserver 8.8.4.4
# --- END PVE ---
root@debian1:~#

That does not look right to me. Also, when editting it, after reboot it gets overwritten again.
Using static IP configuration.

Gr
 
How does the CT config look like (cat /etc/pve/lxc/<vmid>.conf)?
 
root@hypervisor:/etc/pve/lxc# cat 100.conf
arch: amd64
cores: 1
hostname: server1
memory: 512
nameserver: 8.8.4.4
net0: name=eth0,bridge=vmbr0,gw=172.xx.xx.254,hwaddr=xx:xx:FC:31:A5:DD,ip=172.xx.xx.101/24,type=veth
onboot: 1
ostype: debian
parent: beforeresize
rootfs: VM-Storage:vm-100-disk-1,size=2G
searchdomain: 8.8.8.8
swap: 512

[beforeresize]
arch: amd64
cores: 1
hostname: server1
memory: 512
nameserver: 8.8.4.4
net0: name=eth0,bridge=vmbr0,gw=172.xx.xx.254,hwaddr=xx:xx:FC:31:A5:DD,ip=172.xx.xx.101/24,type=veth
onboot: 1
ostype: debian
rootfs: VM-Storage:vm-100-disk-1,size=1G
searchdomain: 8.8.8.8
snaptime: 1538771556
swap: 512


I must add, that I do have this with all my containers and a friend who is running Proxmox is having the same issue. I guess that it is easy reproduced. Just create container from Proxmox GUI, debian 9 container template, use static IP (not dhcp) and dns settings of hypervisor .. I don't know if it also occurs with DHCP. it might not because that info (searchdomain/nameserver) is most likely passed and set by DHCP-client then...

By the way, this is what hypervisor resolv.conf looks like, domain is set OK there.

root@hypervisor:/etc/pve/lxc# cat /etc/resolv.conf
search mydomainname.com
nameserver 8.8.8.8
nameserver 8.8.4.4
root@hypervisor:/etc/pve/lxc#

Because it is already wrong in the VMID.conf, I guess it's just written wrong in config-file by webgui on creation???
 
Last edited:
The containers have the searchdomain configured with the IP.

Yes.. that *is* the bug ... ;-)

I did not do that manually... It is written wrong in the LXC vmid.conf when the container is created from webgui.
Instead of searchdomain it takes the IP of first dns-server, the ip of first dns server is the 2nd ip.. so everything seems moved 'up' 1 line.
Config should be inherited correctly from resolv.conf data on hypervisor (which IS correct, see above)
 
This needs to be explicitly set on CT creation, otherwise the key will not be set in the config.
2018-10-23-125315_505x178_scrot.png

EDIT: On which 'pveversion -v' are you?
 
This needs to be explicitly set on CT creation, otherwise the key will not be set in the config.
View attachment 8482

EDIT: On which 'pveversion -v' are you?

Yeah I use 'Use host settings' on container creation. The host/hypervisor settings (searchdomain and dnsserver ips) are correctly set but like I said, in containers vmid.conf and as a result inside container the resolv.conf information is not set correctly.
I'm quite sure it is not correctly written in vmid.conf. IP of first DNS-server is set as searchdomain instead of the searchdomain itself.
As a result the first DNSserver is the 2nd dnsserver-IP and the second DNS is missing.

pve-version:

proxmox-ve: 5.2-2 (running kernel: 4.15.18-7-pve)
pve-manager: 5.2-10 (running version: 5.2-10/6f892b40)
pve-kernel-4.15: 5.2-10
pve-kernel-4.15.18-7-pve: 4.15.18-27
pve-kernel-4.15.18-5-pve: 4.15.18-24
pve-kernel-4.15.18-4-pve: 4.15.18-23
pve-kernel-4.15.18-2-pve: 4.15.18-21
pve-kernel-4.15.18-1-pve: 4.15.18-19
pve-kernel-4.15.17-1-pve: 4.15.17-9
corosync: 2.4.2-pve5
criu: 2.11.1-1~bpo90
glusterfs-client: 3.8.8-1
ksm-control-daemon: 1.2-2
libjs-extjs: 6.0.1-2
libpve-access-control: 5.0-8
libpve-apiclient-perl: 2.0-5
libpve-common-perl: 5.0-40
libpve-guest-common-perl: 2.0-18
libpve-http-server-perl: 2.0-11
libpve-storage-perl: 5.0-30
libqb0: 1.0.1-1
lvm2: 2.02.168-pve6
lxc-pve: 3.0.2+pve1-3
lxcfs: 3.0.2-2
novnc-pve: 1.0.0-2
proxmox-widget-toolkit: 1.0-20
pve-cluster: 5.0-30
pve-container: 2.0-28
pve-docs: 5.2-8
pve-firewall: 3.0-14
pve-firmware: 2.0-5
pve-ha-manager: 2.0-5
pve-i18n: 1.0-6
pve-libspice-server1: 0.14.1-1
pve-qemu-kvm: 2.11.2-1
pve-xtermjs: 1.0-5
qemu-server: 5.0-36
smartmontools: 6.5+svn4324-1
spiceterm: 3.0-5
vncterm: 1.5-3
zfsutils-linux: 0.7.11-pve1~bpo1
 
I can't reproduce it. What values did you insert when you created the CT?
 
Alwin, I did create new container just now, step by step.
Weirdly, now it worked correctly. I did make the containers that had problem a while ago, not with this particular version. Maybe it is fixed in meantime. I'm not sure what happened, it was not a 1 time thing...

create CT,
ct id 106
hostname test
unpriv-container NOT tagged
password set, next
template: debian-9.0-standard_9.5-1_amd64.tar.gz
root-disk: vm-store, size 2 gb, enablequota not checked, ACLs default, skip replication not checked.
cpu cores 1
memory 512/512
network name eth0, bridge vmbr0 ipv4 static ip/subnetmask, rest default
DNS: dns domain/dns servers left blank (in grey it says 'use host settings'
confirm
 
Alwin, I did create new container just now, step by step.
Weirdly, now it worked correctly. I did make the containers that had problem a while ago, not with this particular version. Maybe it is fixed in meantime. I'm not sure what happened, it was not a 1 time thing...
I am glad that it worked.
 
Just found this thread, so if I'm seeing correctly if you do not fill in the dns and tell him to use the host dns settings it will setup, otherwise if you define the dns yourself, somehow its getting the first dns entry as the searchdomain.
This is happening with me :(

Code:
arch: amd64
cores: 2
hostname: lxc-logstash01
memory: 4096
nameserver: 192.168.193.111
net0: name=eth0,bridge=vmbr0,firewall=1,gw=192.168.193.1,hwaddr=E6:6F:FA:79:8E:DE,ip=192.168.193.106/24,type=veth
onboot: 1
ostype: debian
rootfs: SauronVMs:subvol-503-disk-0,size=10G
searchdomain: 192.168.193.110
swap: 512

Is there a way to change it after container created? Thanks
 
@rechena, on what pveversion -v are you?

Hi @Alwin see bellow:

Code:
root@sauron:~# pveversion -v
proxmox-ve: 6.1-2 (running kernel: 5.3.18-2-pve)
pve-manager: 6.1-7 (running version: 6.1-7/13e58d5e)
pve-kernel-helper: 6.1-6
pve-kernel-5.3: 6.1-5
pve-kernel-5.3.18-2-pve: 5.3.18-2
ceph-fuse: 12.2.11+dfsg1-2.1+b1
corosync: 3.0.3-pve1
criu: 3.11-3
glusterfs-client: 5.5-3
ifupdown: 0.8.35+pve1
ksm-control-daemon: 1.3-1
libjs-extjs: 6.0.1-10
libknet1: 1.15-pve1
libpve-access-control: 6.0-6
libpve-apiclient-perl: 3.0-3
libpve-common-perl: 6.0-13
libpve-guest-common-perl: 3.0-3
libpve-http-server-perl: 3.0-4
libpve-storage-perl: 6.1-5
libqb0: 1.0.5-1
libspice-server1: 0.14.2-4~pve6+1
lvm2: 2.03.02-pve4
lxc-pve: 3.2.1-1
lxcfs: 3.0.3-pve60
novnc-pve: 1.1.0-1
proxmox-mini-journalreader: 1.1-1
proxmox-widget-toolkit: 2.1-3
pve-cluster: 6.1-4
pve-container: 3.0-21
pve-docs: 6.1-6
pve-edk2-firmware: 2.20200229-1
pve-firewall: 4.0-10
pve-firmware: 3.0-6
pve-ha-manager: 3.0-8
pve-i18n: 2.0-4
pve-qemu-kvm: 4.1.1-3
pve-xtermjs: 4.3.0-1
qemu-server: 6.1-6
smartmontools: 7.1-pve2
spiceterm: 3.1-1
vncterm: 1.6-1
zfsutils-linux: 0.8.3-pve1
 
Please update to the latest packages. The lxc packages are on version 4.x.
 
Please update to the latest packages. The lxc packages are on version 4.x.
ah... will do. I got this ISO a couple weeks back should they come with old packages? Thanks

ps: sorry n00b here, does a simple # apt-get upgrade will do for this upgrade?

Code:
The following packages will be upgraded:
  apt apt-utils base-files fuse iputils-ping libapt-inst2.0 libapt-pkg5.0 libcups2 libfuse2 libgnutls30 libgnutlsxx28
  libicu63 libldap-2.4-2 libldap-common libnss-systemd libpam-systemd libpango-1.0-0 libpangocairo-1.0-0
  libpangoft2-1.0-0 libssl1.1 libsystemd0 libudev1 linux-libc-dev openssl postfix systemd systemd-sysv tzdata udev
29 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 25.0 MB of archives.
After this operation, 45.1 kB of additional disk space will be used.

Don't see mention to lxc. Thanks
 
Hello, everyone. I have some error.

ver. Proxmox: 8.0.4
lxc debian 12.0.1

On the host:
1695280463892.png
1695280492086.png

On the LXC:
1695280428701.png
1695280441365.png
1695280552094.png

If i change IPv4 to static - it`s all ok.

1695280698119.png
after reboot:
1695280868270.png

If i change IPv4 to DHCP again and reboot - error again!
 

About

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 yours easily in our online shop.

Buy now!