I have a Proxmox host 192.168.0.1 and a set of VMs on. [code] When I do this: [code]…
- User
I have a Proxmox host 192.168.0.1 and a set of VMs on.
codeauto lo iface lo inet loopback iface lo inet6 loopback # lan card 1: Broadcom BCM57414 NetXtreme-E auto enp193s0f0np0 iface enp193s0f0np0 inet static address 162.55.232.166/26 gateway 162.55.232.129 # route 162.55.232.128/26 via 162.55.232.129 up route add -net 162.55.232.128 netmask 255.255.255.192 gw 162.55.232.129 dev enp193s0f0np0 # private sub network, virtual bridge with NAT auto vmbr0 iface vmbr0 inet static address 192.168.0.1/24 bridge_ports none bridge_stp off bridge_fd 0 # Enable IP forwarding post-up echo 1 > /proc/sys/net/ipv4/ip_forward # NAT configuration post-up iptables -t nat -A POSTROUTING -s '192.168.0.0/24' -o enp193s0f0np0 -j MASQUERADE post-down iptables -t nat -D POSTROUTING -s '192.168.0.0/24' -o enp193s0f0np0 -j MASQUERADEWhen I do this:
codeiptables -t nat -A PREROUTING -p tcp --dport 53 -j DNAT --to-destination 192.168.0.11:53 iptables -t nat -A PREROUTING -p udp --dport 53 -j DNAT --to-destination 192.168.0.11:53Host has proper DNS redirecting to Pihole, but VMs have DNS blocked.
Also,
code - Assistant
The issue arises because your iptables rules for redirecting DNS traffic are too broad—they apply to all DNS traffic, including that from your VMs. This causes DNS queries from the VMs to be redirected in a way that breaks their DNS resolution.
To fix this, you need to modify your iptables rules to apply only to traffic from the external network interface (
enp193s0f0np0) and not to the traffic from your VMs on the internal network (192.168.0.0/24). Here's how you can adjust your rules:bashiptables -t nat -A PREROUTING -i enp193s0f0np0 -p tcp --dport 53 -j DNAT --to-destination 192.168.0.11:53 iptables -t nat -A PREROUTING -i enp193s0f0np0 -p udp --dport 53 -j DNAT --to-destination 192.168.0.11:53By adding
-i enp193s0f0np0, you ensure that only DNS traffic coming in from the external network is redirected to your Pi-hole at192.168.0.11. This prevents the VMs' DNS traffic from being incorrectly redirected, allowing them to resolve DNS queries properly.