π ~1 min read
Table of contents
Symptom & Impact
Custom DNS entries in netplan are ignored, causing failed name resolution and service outages.
Environment & Reproduction
Appears after editing YAML with invalid indentation or conflicting renderer settings.
ls /etc/netplan
cat /etc/netplan/*.yaml
networkctl status
resolvectl status
Root Cause Analysis
Netplan validation passes partially, but DNS is overridden by NetworkManager, systemd-resolved, or cloud-init.
Quick Triage
Confirm renderer and effective resolver source before reapplying.
sudo netplan get
cat /etc/systemd/resolved.conf
ls -l /etc/resolv.conf
resolvectl dns
Step-by-Step Diagnosis
Generate debug output and inspect whether final config includes intended nameservers.
sudo netplan generate --debug
sudo netplan try
resolvectl status
journalctl -u systemd-resolved -n 60 --no-pager

Solution – Primary Fix
Correct netplan YAML, apply, and restart resolver services in controlled order.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.
sudoedit /etc/netplan/01-netcfg.yaml
sudo netplan generate
sudo netplan apply
sudo systemctl restart systemd-resolved
resolvectl flush-caches

Solution – Alternative Approaches
If cloud-init keeps overriding network config, disable its network rendering.
printf 'network: {config: disabled}
' | sudo tee /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
sudo netplan apply
sudo reboot
Verification & Acceptance Criteria
Accepted when nameserver list and DNS query results match intended configuration.
resolvectl dns
resolvectl query archive.ubuntu.com
ping -c 2 security.ubuntu.com
Rollback Plan
Restore previous YAML and reapply if new config causes packet loss or DNS outage.
sudo cp -a /etc/netplan /root/netplan.rollback.$(date +%s)
sudo cp /root/netplan.backup.yaml /etc/netplan/01-netcfg.yaml
sudo netplan apply
Prevention & Hardening
Version-control netplan files and validate syntax in CI before production rollout.
sudo apt install yamllint -y
yamllint /etc/netplan/*.yaml
sudo netplan generate --debug
Related Errors & Cross-Refs
Related errors include YAML parser exceptions, temporary failure in name resolution, and fallback DNS server usage.
Related tutorial: View the step-by-step tutorial for Ubuntu 26.04 LTS.
View all Ubuntu 26.04 LTS tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
Netplan documentation, systemd-resolved manual, and Ubuntu cloud-init networking notes.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today β we respond within one business day.