Fix Ubuntu Failed to Fetch & Temporary Failure Resolving DNS Errors.

When you are trying to update your Ubuntu Server or Ubuntu Desktop sometime you may experience that “Temporary failure resolving ‘archive.ubuntu.com‘” and “Temporary failure resolving ‘ppa.launchpad.net‘” and “Some index files failed to download. They have been ignored, or old ones used instead” errors.

Apart from that if you have Ubuntu server, your WordPress sites start to show “WP HTTP Error: curl error 6: Could not resolve host:” error or Ubuntu DNS not resolving.

The main issue for these errors are your DNS address. Sometimes your “etc/resolv. conf” symbolic link broken, or it has an error. With a simple fix we can eliminate this error.

Ubuntu Logo

How to Fix Ubuntu DNS address issue.

The first solution is installing the resolvconf package. This installation can be done by using the terminal window. Just run the following simple command line in your terminal window.


Now everything installed and automatically configured. If you reboot your Ubuntu VPS or desktop machine changes made to resolv.conf will be erased. To make the DNS changes permanent, follow the below changes.

 

Make Permanent Changes Ubuntu DNS in resolv.conf 

Then open the Linux configuration file which we need to edit.

Then paste the following line to create a directory.


Navigate to the newly created folder by running the following command line.


Then type the following code to create the file.


Type “i” without quotes. Then, add the following lines,

nameserver 1.1.1.1
nameserver 1.0.0.1

Then press “Shift” key with “Z” key twice to save and exit.

Then change the tail file DNS server type the following command.


Type “i” without quotes. Then, add the following Cloudflare DNS server address,

nameserver 1.1.1.1
nameserver 1.0.0.1

Then press “Shift” key with “Z” key twice to save and exit.

Now reboot your Ubuntu Server or Desktop to apply new DNS address.