No name resolution on new Ubuntu 18 vm
See original GitHub issueApologies if this is not the correct place for this issue.
My team is building templates with Packer and deploying VMs with az group create deployment ...
, based loosely on these docs: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/build-image-with-packer
I noticed that after the provisioning done by Packer, waagent deletes resolv.conf. This is fine, and works as expected when deploying a 16 vm.
However as we attempt to move onto Ubuntu 18, when the vm is created, /etc/resolv.conf
is missing, meaning it is not recreated when the vm is created from the disk image. nslookup microsoft.com
times out, and no names are resolved when using eg curl. systemd-resolve
however does work.
Is this something waagent is responsible for?
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (4 by maintainers)
Top Results From Across the Web
DNS Resolve is not working on 18.04 server - Ask Ubuntu
I stumbled with the same and solved it by strict syntax in the /etc/netplan/99-netcfg-vmware.yaml: I added spaces around the nameservers and ...
Read more >Microsoft releases potential fix for Azure errors in Ubuntu ...
Microsoft reported that a number of Azure customers who use Ubuntu 18.04 virtual machines are experiencing DNS resolution errors and .
Read more >Fixing DNS Issues in Ubuntu 18.04 LTS | by Ahmad Bilal
Short post today, on fixing DNS issues in the latest Ubuntu 18.04 LTS. I upgraded my ThinkPad from Ubuntu 16.04 LTS, and started...
Read more >How to Resolve the "Temporary failure in name resolution" Error
The "Temporary failure in name resolution" error appears due to bad system configuration. This article shows how to troubleshoot and fix it.
Read more >Ubuntu 18.04 systemd security update breaks DNS in Azure ...
The situation is as odd as it sounds: if you're running Ubuntu 18.04 in an Azure virtual machine, and you installed the systemd ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To whom it may interest,
The issue described happens when the Ubuntu 18.04 is deployed from an image deprovisioned with waagent.
When a new server is deployed the symlink to /run/systemd/resolve/stub-resolv.conf resolv.conf is not restored and as consequence the server cannot find a DNS server where to send queries.
Restoring the link manually does fix the problem after the customized virtual machine has been deployed. However in order to prevent further deployments with the same problem it’s necessary to deprovision and restore the symlink as the root user on the original virtual machine ( you need root privileges to restore the symlink and sudo won’t work after “waagent -deprovision+user” ).
So you should start the creation of a new Ubuntu 18.04 server image with these commands:
sudo -i
waagent -deprovision+user
cd /etc; ln -s …/run/systemd/resolve/stub-resolv.conf resolv.conf
@paulmey I agree - we should not be touching this file, I merged a fix to master.
@dakale the referenced change in #1164 should address your issue, if you are installing from source. If you have any problems, please reopen this issue.