LXC Debian DHCP/DNS resolv.conf misunderstanding

aqwserf

New Member
Nov 25, 2019
8
0
1
54
Hi !

I've got some LXC with dual NIC, one for admin (ssh) and the other for services (NFS, http...) and they got their configuration from DHCP (OpenWRT). Both LAN have their own domain (admin.lan / services.lan).
Here's the LXC configuration:

Code:
arch: amd64
cores: 1
hostname: proxy
memory: 512
net0: name=eth0,bridge=vmbr0,hwaddr=F6:F4:67:DF:A6:2D,ip=dhcp,type=veth
net1: name=eth1,bridge=vmbr2,hwaddr=72:E2:3F:72:89:07,ip=dhcp,type=veth
onboot: 1
ostype: debian
parent: tempo
rootfs: local-lvm:vm-301-disk-0,mountoptions=noatime,size=8G
swap: 512
unprivileged: 1

From scratch (debian-10.0-standard_10.0-1_amd64.tar.gz), the container got his configuration with isc-dhcp-client (apparently), installed by default, which only gets the last (apparently) declared NIC (in order of appearance in Proxmox LXC configuration):

Code:
cat /etc/resolv.conf
domain service.lan
search service.lan
nameserver 192.168.64.254

But I'd like it to have both LAN resolution, so I installed dnsmasq and configure it accordingly in addition with resolvconf and now, my resolv.conf file looks like this:

Code:
# --- BEGIN PVE ---
search admin.lan
nameserver 192.168.33.254
# --- END PVE ---

even if the Proxmox LXC's configuration is empty.

What process is responsible to that ? If I touch /etc/.pve-ignore.resolv.conf, the file is no longer modified by Proxmox, but it doesn't look correct anyway.
Who modifies this file in order ? isc -> dnsmasq -> resolvconf -> proxmox ?
How can I have, in a KIS way, a resolv.conf file like nameserver 127.0.0.1 ?

Thank you !
 
hi,

you can give a list of DNS servers in the settings and never have to deal with any of this

in the GUI, Container -> DNS -> DNS Server and just type both servers' IP with a space inbetween, like for example 1.1.1.1 8.8.8.8
 
Thanks @oguz for your reply.
That's right, but I have to install resolvconf, otherwise, the Proxmox configuration doesn't stand and get overwritten by isc-dhcp-client (I think). Do you have any clue why ?
And even after modifying this, it continues to use the first DNS resolver in the file (who doesn't know the domain belonging to the second interface), that's why I looked into dnsmasq.
 

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!