I am trying to create 2 ubuntu 22.04 VMs through cloud-init. The nameserver config in cloud-init is not reflecting in /etc/resolve.conf. Due to this, the dns resolution isn't working for the hosts in the same network.
output of
Output of
output of
If I add the line
I tried a few options but none of these works.
- Clear the cloud-init and restart
- change 50-cloud-init.yaml and reapply netplan
- Use DHCP instead of static ip
Is there anything else I can try to troubleshoot this.?
output of
cat /etc/netplan/50-cloud-init.yaml
Bash:
network:
version: 2
ethernets:
eth0:
addresses:
- 192.168.10.30/24
match:
macaddress: 0a:0b:30:d8:db:d3
nameservers:
addresses:
- 192.168.1.10
search:
- localdomain
routes:
- to: default
via: 192.168.10.1
set-name: eth0
Output of
resolvectl status
Bash:
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
Link 2 (eth0)
Current Scopes: DNS
Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 192.168.1.10
DNS Servers: 192.168.1.10
DNS Domain: localdomain
Link 3 (docker0)
Current Scopes: none
Protocols: -DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
output of
cat /etc/resolv.conf
Code:
nameserver 127.0.0.53
options edns0 trust-ad
search localdomain
If I add the line
nameserver 192.168.1.10
in the resolv.conf, the DNS resolution works.I tried a few options but none of these works.
- Clear the cloud-init and restart
- change 50-cloud-init.yaml and reapply netplan
- Use DHCP instead of static ip
Is there anything else I can try to troubleshoot this.?
Last edited: