LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-03-2014, 11:35 AM   #1
ngiw2012
LQ Newbie
 
Registered: Jun 2014
Posts: 13

Rep: Reputation: Disabled
How can we make Squid do a reverse nslookup?‏


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-flv

1286536351.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-flv

We 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 minute
17 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 ......

Can I achieve this using something like srcdomain access list?
 
Old 06-03-2014, 03:21 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,737

Rep: Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585
Hi,

You can use the log_fqdn directive to allow reverse lookups.
This has a negative impact on performance, so think if you want to use it or not.

Regards
 
1 members found this post helpful.
Old 06-03-2014, 04:20 PM   #3
ngiw2012
LQ Newbie
 
Registered: Jun 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Thanks a lot but the link that you have give me isn't helpful alot , can you give me more useful command or a quick tutorial of How can I use log_fqdn

especially, where I can change the value: log_fqdn off to log_fqdn on

Last edited by ngiw2012; 06-03-2014 at 04:22 PM.
 
Old 06-04-2014, 12:31 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,737

Rep: Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585Reputation: 1585
Quote:
Originally Posted by ngiw2012 View Post
Thanks a lot but the link that you have give me isn't helpful alot , can you give me more useful command or a quick tutorial of How can I use log_fqdn

especially, where I can change the value: log_fqdn off to log_fqdn on
It's not a command. It's a squid configuration directive.
You are supposed to use it in squid.conf. Open squid.conf with your favorite editor, add
Code:
log_fqdn on
save and restart the squid service
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Squid reverse proxy help, Any Squid expert here please mirjee4u Linux - Server 2 05-08-2014 04:19 AM
how to make nslookup return failure if DNS server fails bennetthaselton Linux - Networking 2 03-23-2011 08:32 PM
Squid reverse proxy triptec Linux - Networking 0 12-08-2009 06:30 PM
alsa programming problem in set frames and buffer size‏‏ wswhp Linux - Kernel 1 12-04-2008 02:39 AM
Squid 2.6 Reverse Proxy from Squid(3128) to OrginServer(80) Not working rraj Linux - Server 0 06-06-2008 02:29 PM


All times are GMT -5. The time now is 09:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration