大网数据广告活动
服务器运维问答

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

· 52CE 我爱测

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…

问题原文

原帖链接 · user3770797 · CC BY-SA 4.0

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?

已采纳解答

原帖链接 · Itai Ganot · CC BY-SA 4.0

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

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-08-28)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。