Hetzner ubuntu dns resolution not working

domain-name-systemhetznerinterfaceopnsensevirtual-machines

I created a natgateway using opnsense

I created a VM in a private network which is behind the natgateway so that all internet traffic will pass through opensense into the client VM

I can ping google ip (142.250.190.142) through opnsense which works fine

but I can't ping the domain name www.google.com and also I can't update OS using apt update

I get error this

temporary failure in name resolution

I am using hetzner cloud provider for VMs

the archecture of hetzner is that de default gateway take the first ip address since servers are not connected directly. The flow is like this (client server > gateway > opnsense)

Interface config on the client VM

/etc/network/interfaces

auto lo
iface lo inet loopback
auto enp7s0
iface enp7s0 inet dhcp
   post-up ip route add default via 10.0.0.1
   dns-nameservers 185.12.64.2 185.12.64.1

IP address

opnsense router 10.0.0.2
VM 10.0.0.3
gateway 10.0.0.1

enter image description here

Best Answer

I edited this file /etc/systemd/resolved.conf and added dns

Related Topic