Thursday, June 22, 2017

Unable to resolve host '' ubuntu 14.04



I face this issue when I was adding new web site to my web server which is hosted in Digital Ocean Cloud service.  So what happened was, when I using sudo commands to restart or reload apache2 server its restring with following error messages.

For me everything worked well despite these two  error messages.

1. Error 1 - Unable to resolve host 'YOUR HOST NAME'  .
2. Error 2 - sum_functio_error() //I don't remember this function name I'll update this later.

So the fix was very simple.

First open your hotsts file.

sudo nano /etc/hosts

Output File

127.0.1.1 hostname
127.0.0.1 localhost


sudo nano /etc/hostname


Output File

hostnamexxx



So in my case hostname in hostname file and hosts file difference.So  I put the hostnamexxx in hosts file and restarted the server.

*You have to restart your server to apply any hosts file changes.


Please comment bellow if you need further explanation.








No comments:

Post a Comment