How to fix ‘Could not resolve’

In case you are running Ubuntu OS, you may find it could not resolve to Especially if you’re trying to install new software this issue might be annoying asd you won’t be able to upgrade / install any dependencies.
You can sort out this issue by simply updating the server DNS address into the following Ubuntu file.
Login to your server as a root user or run the following command to switch to root from sudo user.
sudo su
Run the following command to modify the configuration file.
nano /etc/resolv.conf
Add this two lines in the starting of the file. or if it’s already existing in the file, simply delete that and insert the following. After editing, click Ctrl + x and y then press Enter.
This will now use Google DNS to resolve.
Google Public DNS is a Domain Name System service offered to Internet users worldwide by Google. It functions as a recursive name server.

Before making changes to the file, you may take a backup, in case there’s any problem you can restore it.
cp /etc/resolv.conf /etc/resolv.conf.backup
Next time you should not  face the problem of “Could not resolve”.
Please comment below if there’s still same issues with your server.

Leave a Comment