[squid-users] DNS lookup fails initially for FQDN in squid

Aashima Madaan amadaan at ncsu.edu
Fri May 27 15:51:36 UTC 2016

> So, does the problem exist if you:

> 1. Stop Squid
> 2. Type "host short.domain.name" to resolve the ICAP server manually
> 3. Start Squid

> (The last two commands in as quick succession as possible - preferably on a
> single line separated by a semi-colon)

yes the problem still exists

>>* I see in cache.log that its adding nameservers from /etc/resolv.conf
*>> >>* 2016/05/27 10:32:52 kid1| Adding nameserver from
*>>* 2016/05/27 10:32:52 kid1| Adding nameserver from /etc/resolv.conf
*>>* 2016/05/27 10:32:52 kid1| Adding nameserver from /etc/resolv.conf
> Why have you added twice?

That was by chance. Its

>* > Is that DNS server running and answering queries before the Squid
*>* > server/service starts up?
*> >* I do curl/ping/nslookup for icap server from squid machine, it is able to
*>* resolve that particular ip.
> You do this before starting Squid, and it works, and then when you start
Squid, it fails for 3 minutes??

Yes, after 3 minutes it's able to resolve DNS and brings up the service.

on additional debugging by switching on tcpflow, I see squid sends
OPTIONS request to icap server and that is when it is able to resolve
DNS and which brings the service up in 3 minutes.


OPTIONS icap://short.domain.name:1344 ICAP/1.0

Host: short.domain.name:1344

Allow: 206


ICAP/1.0 200 OK


Options-TTL: 3600

Encapsulated: null-body=0

Max-Connections: 400

Preview: 30

Service: Gateway 7.5.2

ISTag: "00005042-2.94.230-00008178"

Allow: 204


Additionally, i increased debug level and saw this in cache logs

 Address.cc(389) lookupHostIP: Given Non-IP 'short.domain.name': Name
or service not known

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20160527/2ddc5b19/attachment.html>

More information about the squid-users mailing list