LXC DNS name not working

timonych

Active Member
Aug 8, 2017
60
13
28
32
Hello,

After last upgrade all my containers can't find IP by name
Code:
ping: ya.ru: Name or service not known

But main host is working properly

Code:
root@zeus:~# ping ya.ru
PING ya.ru (87.250.250.242) 56(84) bytes of data.
64 bytes from ya.ru (87.250.250.242): icmp_seq=1 ttl=52 time=8.90 ms
64 bytes from ya.ru (87.250.250.242): icmp_seq=2 ttl=52 time=7.30 ms
64 bytes from ya.ru (87.250.250.242): icmp_seq=3 ttl=52 time=7.18 ms

Code:
proxmox-ve: 5.1-42 (running kernel: 4.13.16-2-pve)
pve-manager: 5.1-51 (running version: 5.1-51/96be5354)
pve-kernel-4.13: 5.1-44
pve-kernel-4.13.16-2-pve: 4.13.16-47
pve-kernel-4.13.16-1-pve: 4.13.16-46
pve-kernel-4.13.13-2-pve: 4.13.13-33
corosync: 2.4.2-pve4
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-4
libpve-common-perl: 5.0-30
libpve-guest-common-perl: 2.0-14
libpve-http-server-perl: 2.0-8
libpve-storage-perl: 5.0-18
libqb0: 1.0.1-1
lvm2: 2.02.168-pve6
lxc-pve: 3.0.0-2
lxcfs: 3.0.0-1
novnc-pve: 0.6-4
proxmox-widget-toolkit: 1.0-15
pve-cluster: 5.0-25
pve-container: 2.0-21
pve-docs: 5.1-17
pve-firewall: 3.0-8
pve-firmware: 2.0-4
pve-ha-manager: 2.0-5
pve-i18n: 1.0-4
pve-libspice-server1: 0.12.8-3
pve-qemu-kvm: 2.11.1-5
pve-xtermjs: 1.0-2
qemu-server: 5.0-25
smartmontools: 6.5+svn4324-1
spiceterm: 3.0-5
vncterm: 1.5-3
zfsutils-linux: 0.7.7-pve1~bpo9
 

timonych

Active Member
Aug 8, 2017
60
13
28
32
If Istop container and start it DNS working next 15 seconds.

There is no such problem with VMachines, only with Containers.

Additional:

Check container CentOS and Archlinux. With CentOS problem exists,with ArchLinux there is no such problem.
 

dcsapak

Proxmox Staff Member
Staff member
Feb 1, 2016
7,825
945
163
33
Vienna
what is the container config?
 

timonych

Active Member
Aug 8, 2017
60
13
28
32
what is the container config?
This is CentOS
Code:
arch: amd64
cores: 2
hostname: HTTP
memory: 256
net0: name=eth0,bridge=vmbr0,hwaddr=00:FD:45:A2:0C:D8,ip=dhcp,ip6=dhcp,type=veth
onboot: 1
ostype: centos
rootfs: ZFS-SSD:subvol-101-disk-1,size=2G
startup: order=6,up=30
swap: 128
This is ArchLinux
Code:
arch: amd64
cores: 1
hostname: Proxy
memory: 96
net0: name=eth0,bridge=vmbr0,hwaddr=00:FD:45:55:77:78,ip=dhcp,ip6=dhcp,type=veth
onboot: 1
ostype: archlinux
rootfs: ZFS-SSD:subvol-110-disk-1,size=1G
startup: order=1,up=15
swap: 96
 

dcsapak

Proxmox Staff Member
Staff member
Feb 1, 2016
7,825
945
163
33
Vienna
how does the /etc/resolv.conf of the centos container look? (and which centos version is it?)
 

timonych

Active Member
Aug 8, 2017
60
13
28
32
how does the /etc/resolv.conf of the centos container look? (and which centos version is it?)
CentOS 7
Code:
; generated by /usr/sbin/dhclient-script
nameserver fdf2:e90d:d990::1
So as I can see, resolv.conf is not normal, but why?

And if I change is manually will it be saved after reboot or will be change by host after reboot?

Additional: No, after some seconds it replaced by /usr/sbin/dhclient-script to nameserver fdf2:e90d:d990::1
 

dcsapak

Proxmox Staff Member
Staff member
Feb 1, 2016
7,825
945
163
33
Vienna
seems your dhcp server only gives a ipv6 dns server ?
 

timonych

Active Member
Aug 8, 2017
60
13
28
32
seems your dhcp server only gives a ipv6 dns server ?
No, I turn off ipv6.

resolv.conf of Arch is correct.

Before upgrading and reboot all works perfect.

I have found a solution - Set ipv6 for Container Static mode. It helps me. Now resolv.conf is correct.

Thanks for helping to find a problem and solution!

upload_2018-4-18_14-35-19.png
 
Sep 18, 2019
32
4
13
27
I did face the same issue with a fresh Debian LXC (debian-10.0-standard_10.0-1_amd64.tar.gz)
Setting IPv4 to DHCP and IPv6 to DHCP in the config leads to a bug in the /etc/resolv.conf. Then there is only the IPv6 nameserver, not the IPv4 nameserver.
Setting IPv4 to DHCP and IPv6 to SLAAC, the /etc/resolv.conf has the correct IPv4 nameserver, but no IPv6 DNS servers.
Any Update on that?
 

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 your own in 60 seconds.

Buy now!