Linux – sudo: Unable to Resolve Host server1.yourdomain.com: Resource Temporarily Unavailable

linuxPROXYsquidUbuntu

OS: Ubuntu 18.0.4

i install Squid with this command:

sudo apt-get install squid

after install i small change on squid.conf , only change this http_access deny all to http_access allow all

after save change i run this command

sudo service squid restart

but i get this error:

sudo: unable to resolve host server1.yourdomain.com: Resource temporarily unavailable

and i check my hosts file , i see this text:

127.0.0.1   localhost
127.0.1.1   ubuntu

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

i check my hostname file , i see this text:

server1.yourdomain.com

i change this text to ubuntu

after change i run again this command:

sudo service squid restart

and this command

sudo service squid stop

but i get again this error:

sudo: unable to resolve host server1.yourdomain.com: Resource temporarily unavailable

and test this command:

sudo service squid reload
sudo: unable to resolve host server1.yourdomain.com: Resource temporarily unavailable
squid.service is not active, cannot reload.

i check ping ip , get good ping

how to fix this problem?

Best Answer

Your machine tries to resolve server1.yourdomain.com but fails.

The first step of dns resolving is that the instance is looking in its own /etc/hosts file before checking the next dns server.

Simply edit the server's /etc/hosts file and change this line: 127.0.0.1 localhost to:

127.0.0.1 localhost server1.yourdomain.com

Then restart squid service:

service squid restart
Related Topic