[SOLVED] /etc/resolv.conf not populated by nameserver

Fathi

Renowned Member
May 13, 2016
139
8
83
53
Tunis, Tunisia
Hi, strange behavior of centos 8 containers under proxmox ve 6.4
search is populated with the name of the domain name filled in the proxmox gui but nameserver never gets filled and i have to write it from inside the container once started.
 
* please post the container config `pct config <VMID>`
* please also post the files from inside the container - showing what is missing and should be set
Thanks
 
* please post the container config `pct config <VMID>`
* please also post the files from inside the container - showing what is missing and should be set
Thanks
Hi,
root@pve:~# pct config 100
arch: amd64
cores: 2
hostname: cloud
memory: 8192
nameserver: 1.1.1.1 1.0.0.1 9.9.9.9
net0: name=eth0,bridge=vmbr0,gw=192.168.1.1,hwaddr=16:5F:28:14:BF:B5,ip=192.168.1.206/24,type=veth
onboot: 1
ostype: centos
rootfs: local-lvm:vm-100-disk-0,size=8G
searchdomain: acoustica.earth
startup: order=2
swap: 512
unprivileged: 1

The resulting /etc/resolv.conf is:
[root@cloud ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search acoustica.earth
[root@cloud ~]#

This container is centos 8 stream. Things didn't happen with centos 7 or debian containers on other 6.3 pve servers. Troubles on this server appeared while it was at 6.3 version and now that is 6.4.
I have just created two centos 7 and centos 8 containers and things are as they should be. I think troubles start to happen after converting a stock centos 8 container to centos stream. Needs some more investigation.
 
# Generated by NetworkManager
my guess is the container has network manager installed, and network manager wipes /etc/resolv.conf

please try removing NetworkManager

(PVE sets up CentOS containers with /etc/sysconfig/ network scripts)
 
  • Like
Reactions: Moayad and Fathi
my guess is the container has network manager installed, and network manager wipes /etc/resolv.conf

please try removing NetworkManager

(PVE sets up CentOS containers with /etc/sysconfig/ network scripts)
Your guess is correct and that's what i did but then container network didn't start so i reinstalled NetworkManager.
 
Last edited:
my guess is the container has network manager installed, and network manager wipes /etc/resolv.conf

please try removing NetworkManager

(PVE sets up CentOS containers with /etc/sysconfig/ network scripts)
Solved following this procedure.
 

Attachments

  • screenshot-access.redhat.com-2021.05.15-00_56_49.png
    screenshot-access.redhat.com-2021.05.15-00_56_49.png
    10.2 KB · Views: 204
@Fathi Well done.. many thanks.
I was facing the same issue, your answer worked.

For people who can not see the attachment files, here is the text solution from the attachment above:

As the root, create the file:
/etc/NetworkManager/conf.d/90-dns-none.conf
with the content below:
[main] dns=none

Reboot your server, and you are good to go.
 
  • Like
Reactions: Fathi