LXC DNS name not working

timonych

Well-Known Member
Aug 8, 2017
62
17
48
33
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
 
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.
 
what is the container config?
 
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
 
how does the /etc/resolv.conf of the centos container look? (and which centos version is it?)
 
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
 
seems your dhcp server only gives a ipv6 dns server ?
 
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
 
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?
 
SOLVED: this is exclusively caused by UDHCPC not having a suitable default config
Would you mind expanding on this for me? I am having a similar issue where my container has no access to the net now, despite the host being able to. This happened about 8 days ago, despite everything working fine for a year or more. Struggling what to do to fix/diagnose to be honest.
 
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?

It's still an issue with Debian 11 and Proxmox 7.3-3. ipv6 set to DHCP only has an ipv6 dns server, ipv6 set to SLAAC only has ipv4 DNS servers.
 
I searched for several hours and arrival here with Debian 11 and Promox 7.4-3. Any update?
 
Now, I found this problem.
Set ipv4 to static and ipv6 to DHCP leads to a bug.
Set ipv4 to static and ipv6 to SLAAC, it's OK, but no IPv6 DNS servers.
I have been updated lxc.

host : Linux pve 5.15.104-1-pve
lxc templates : debian-11-standard_11.6-1_amd64.tar.zst
 
Last edited:
Guys, what has it todo with Proxmox?
Thats clearly a dns/dhcp issue on your gateway/firewall whatever.

Slaac is the correct way to provide ipv6 addresses if you got an ipv6 prefix delegation.
With slaac your gateway needs to advertise his own ipv6 address and your dns server needs to advertise the ipv6 address either.
You can even set what to advertise on most gateways either, for example on opnsense you can set what to advertise under Services -> Router Advertisements -> Your Interface -> and there you can add dns servers for example.

With dhcpv6 you can configure everything yourself, like with dhcpv4, but it usually doesn't provide any benefit at all and almost no one uses it, since that will be only local ipv6 addresses, means you need to do nat of some sort to be able to reach the "internet" over ipv6.

Another solution would be simply to setup a wins Server and simply define it in your dhcpv4 server.
So hosts can additionally register to wins.
Which allows to resolve hostnames with hostname.local, similar to mdns.

But anyway, that's off topic and has nothing todo with Proxmox.

Btw, for slaac, you need to set your router advertisements to stateless.

Cheers
 
Last edited:
Guys, what has it todo with Proxmox?
Thats clearly a dns/dhcp issue on your gateway/firewall whatever.

Slaac is the correct way to provide ipv6 addresses if you got an ipv6 prefix delegation.
With slaac your gateway needs to advertise his own ipv6 address and your dns server needs to advertise the ipv6 address either.
You can even set what to advertise on most gateways either, for example on opnsense you can set what to advertise under Services -> Router Advertisements -> Your Interface -> and there you can add dns servers for example.

With dhcpv6 you can configure everything yourself, like with dhcpv4, but it usually doesn't provide any benefit at all and almost no one uses it, since that will be only local ipv6 addresses, means you need to do nat of some sort to be able to reach the "internet" over ipv6.

Another solution would be simply to setup a wins Server and simply define it in your dhcpv4 server.
So hosts can additionally register to wins.
Which allows to resolve hostnames with hostname.local, similar to mdns.

But anyway, that's off topic and has nothing todo with Proxmox.

Btw, for slaac, you need to set your router advertisements to stateless.

Cheers
No, in my case it was not. It really is udhcp deployed by proxmox on the server.
 
  • Like
Reactions: Ramalama

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!