[SOLVED] /etc/resolv.conf in lxc container used as dns server (pi-hole)

norbertk

Renowned Member
Jan 20, 2014
18
7
68
Hello all ,
I use proxmox 7.4-3 under debian bullseye and run a bunch of lxc's One of them is my dns-server with pi-hole and unbound as resolving dns-server. It has 10.10.1.20 as its fixed IP and It is referenced in my router ( 10.10.1.1) as DNS server and the whole thing works but feels slow, especialy in relation th the amount of ressources.

I installed pi-hole and unbound according to its Pi-Hole unbound documentation

The config is as follows:
Code:
root@grossglockner:~# pct config 231
arch: amd64
cores: 3
description: ### Aufgabe%0AWerbekillender DNS-Server %0A### Einzelheiten%0AIst in der Fritzbox eingebunden und wird an Clients im Netz weitergereicht%0A%0AIst selber ein resolving DNS-Server%0A
features: nesting=1
hostname: pi-hole
memory: 1024
net0: name=eth0,bridge=vmbr0,firewall=1,gw=10.10.1.1,hwaddr=EA:A9:12:C1:9C:22,ip=10.10.1.20/32,ip6=fd00::e8a9:12ff:fec1:9c22/64,type=veth
onboot: 1
ostype: debian
rootfs: local-lvm:vm-231-disk-0,size=10308760371
swap: 512
unprivileged: 1

Looking around in the container I found in /etc/resolv.conf the following content and this seems wrong, it makes no sense to have
Code:
root@pi-hole:/etc/unbound/unbound.conf.d# cat /etc/resolv.conf
# --- BEGIN PVE ---
search fritz.box
nameserver 10.10.1.1
# --- END PVE ---
10.10.1.1 is the router
This seems to show that PVE set this information : Why and how does proxmox do this ?
Or is this just old data ?

resolvectl in the container seems to confirm that the setting is used.
Code:
root@pi-hole:/etc/unbound/unbound.conf.d# resolvectl
Global
         Protocols: +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
  resolv.conf mode: foreign
Current DNS Server: 10.10.1.1
       DNS Servers: 10.10.1.1
        DNS Domain: fritz.box

Link 2 (eth0)
Current Scopes: LLMNR/IPv4 LLMNR/IPv6
     Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported

Can I just delete /etc/resolv.conf?

Thanks a lot

Norbert
 
you can set a containers DNS settings in the GUI (select the container, then DNS, and there you can configure the options).