We all know that access.log file logs the access Info of Squid:1286536351.746  41762 192.168.1.17 TCP_MISS/200 5340945 GET http://v15.lscache3.c.youtube.com/videoplayback? - DIRECT/122.160.120.150 video/x-flv1286536351.746  41762 192.168.1.18 TCP_MISS/200 5340945 GET http://v15.lscache3.c.youtube.com/videoplayback? - DIRECT/122.160.120.150 video/x-flvWe all also know that Squid use the file /etc/resolv.conf to determine the DNS server it is dealing with, so if we want Squid to deal with a local DNS server we enter the local DNS server in the file /etc/resolv.conf.What if the local DNS server has a record like this (in its reverse zone (1.168.192.in-addr.arpa)):$TTL 60 ; 1 minute17          PTR Mark.18          PTR Mike.Can I configure Squid to do a reverse lookup (asking about the name of the IP address in the log file) and add the names to the access.log record, for example: I want to make this record:1286536351.746  41762 192.168.1.17 ......to be something  like this:1286536351.746  41762 192.168.1.17 Mark ......How can I reach this?Can I use Squid logformats like %>a and %>A to get what I want?
How can we make Squid do a reverse nslookup?
bind;squid
One method would be to make use of this directive in the squid.conf file to get the log file to show FQDNs instead of the IPs:log_fqdn onSource: http://www.squid-cache.org/Doc/config/log_fqdn/But this will omit the <IP> <Name> format that you're showing in your question. For that if you look at the documentation for the logformat directive the following default formats are listed:logformat squid      %ts.%03tu %6tr %>a %Ss/%03>Hs %<st %rm %ru %[un %Sh/%<a %mtlogformat common     %>a %[ui %[un [%tl] %rm %ru HTTP/%rv %>Hs %<st %Ss:%Shlogformat combined   %>a %[ui %[un [%tl] %rm %ru HTTP/%rv %>Hs %<st %{Referer}>h %{User-Agent}>h %Ss:%Shlogformat referrer   %ts.%03tu %>a %{Referer}>h %rulogformat useragent  %>a [%tl] %{User-Agent}>hAnd these options are listed as parameters that you can use in building up your own format:>a  Client source IP address>A  Client FQDNSo I would expect that you could put this together to get the format that you're asking about.ReferencesSquid configuration directive logformat