How to Fix the Error: “Could not resolve host … No address associated with hostname”

If you get this types of errors, telling you that a host could not be resolved, the problem is with your /etc/resolv.conf file.

Watch Free Movies

'[Could not resolve host: ... No address associated with hostname]'

The easiest solution for this is to edit your /etc/resolv.conf file (with sudo or as root) and replace the nameserver lines with the following lines, which set the Google DNS servers:


Save the file, restart the network and you’re done:

$ sudo /etc/init.d/networking restart

Scroll to Top