[squid-users] WARNING: DNS lookup for 'example.com' failed!

chiasa.men chiasa.men at web.de
Fri Sep 29 15:32:04 UTC 2017


I have to restart squid after each reboot to get it working. I think that is 
because squid starts before systemd has started the network and so the dns 
lookups fail:

journalctl says:
"squid.service: Unit cannot be reloaded because it is inactive."

cache.log contains:
"WARNING: DNS lookup for 'example.com' failed!"


The problems seems to be the squid.service file which I took from ubuntus 
squid package:

# Automatically generated by systemd-sysv-generator

[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/squid
Description=LSB: Squid HTTP Proxy version 3.x
Before=multi-user.target
Before=multi-user.target
Before=multi-user.target
Before=graphical.target
Before=shutdown.target
After=network-online.target
After=remote-fs.target
After=systemd-journald-dev-log.socket
After=nss-lookup.target
Wants=network-online.target
Conflicts=shutdown.target

[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/etc/init.d/squid start
ExecStop=/etc/init.d/squid stop
ExecReload=/etc/init.d/squid reload

Did anybody have the same problem and a nicer solution than adding each 
hostname to /etc/hosts?



More information about the squid-users mailing list