LXC DNS not working

fleabeard

New Member
Jun 12, 2022
19
2
3
I'm having an issue where any newly created LXC's in proxmox pve are unable to ping DNS names but can ping IP's just fine.

Code:
root@ubuntu-server:~# cat /etc/resolv.conf
# --- BEGIN PVE ---
search R610.local
nameserver 192.168.69.1
nameserver 192.168.1.1

1663187751625.png
1663187772526.png

Am I missing something here? Shouldn't this work?
 
Last edited:
Hey,

the two DNS server seem to be on two different networks. A bit of a wild guess, but I assume the LXC is on 192.168.1.0/24 and tries to use 192.168.69.1. Could you try nslookup google.com <DNS> with 192.168.69.1, 192.168.1.1 and 1.1.1.1 as <DNS>? And post ip a.
 
Last edited:
Hey,

the two DNS server seem to be on two different networks. A bit of a wild guess, but I assume the LXC is on 192.168.1.0/24 and tries to use 192.168.69.1. Could you try nslookup google.com <DNS> with 192.168.69.1, 192.168.1.1 and 1.1.1.1 as <DNS>? And post ip a.

I'm assuming you want me to try this nslookup stuff from the LXC itself? If so, here are the results.

When using 192.168.69.1, 192.168.1.1 as the DNS I am unable to ping via DNS and nothing happens when I try to nslookup google.com
Code:
root@rustdesk-server:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0@if146: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 26:33:cf:94:e6:6f brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 192.168.20.125/24 metric 1024 brd 192.168.20.255 scope global dynamic eth0
       valid_lft 7174sec preferred_lft 7174sec
    inet6 fe80::2433:cfff:fe94:e66f/64 scope link
       valid_lft forever preferred_lft forever

When using 1.1.1.1 as the DNS everything works.
Code:
root@rustdesk-server:~# nslookup google.com
Server:         1.1.1.1
Address:        1.1.1.1#53

Non-authoritative answer:
Name:   google.com
Address: 142.251.16.139
Name:   google.com
Address: 142.251.16.113
Name:   google.com
Address: 142.251.16.102
Name:   google.com
Address: 142.251.16.101
Name:   google.com
Address: 142.251.16.100
Name:   google.com
Address: 142.251.16.138
Name:   google.com
Address: 2607:f8b0:4004:c09::66
Name:   google.com
Address: 2607:f8b0:4004:c09::64
Name:   google.com
Address: 2607:f8b0:4004:c09::71
Name:   google.com
Address: 2607:f8b0:4004:c09::8a
 
Both the DNS servers are on a different network than your LXC, and since you can't reach them, there is also no routing setup between those three networks. Either you put the LXC on the same network the DNS you want to use is on, or you have to setup routing between 192.168.20.0/24 and the network your DNS is on.
 
Both the DNS servers are on a different network than your LXC, and since you can't reach them, there is also no routing setup between those three networks. Either you put the LXC on the same network the DNS you want to use is on, or you have to setup routing between 192.168.20.0/24 and the network your DNS is on.
This is confusing as I can create a VM on the same 192.168.20.0/24 network and DNS works as it should. It's only when I attach a CT to this network that DNS doesn't work for the CT.

1663336584842.png
 
Could you post ip a and ip r of the VM? And from the VM both nslookup google.com 192.168.69.1 and nslookup google.com 192.168.1.1 work?
 
Since the VM also can't reach 192.168.69.1 or 192.168.1.1, but can resolve google.com it has to use a different DNS server. As I said before, either you don't use 192.168.69.1 and 192.168.1.1 in your VMs/CTs (by setting for example 1.1.1.1 in /etc/resolv.conf) or you have to setup routing between your networks.
 

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!