Navigation

    Netgate Discussion Forum
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Lightsquid not showing DNS names

    pfSense Packages
    8
    9
    11668
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mrpolitics last edited by

      Ive tried every setting from IP to Squidauth, and all I can get Lightsquid to do is show the IP, but never the DNS entry for the machine.  Any ideas?

      1 Reply Last reply Reply Quote 0
      • D
        dvserg last edited by

        Ou must read description for LS fields and configure this for DNS resolve. All changes will apply for newest data only. All exists report will continue to remain as is.

        SquidGuardDoc EN  RU Tutorial
        Localization ru_PFSense

        1 Reply Last reply Reply Quote 0
        • R
          running last edited by

          I have the same problem but i dont understand wnat you mean. Can you explain
          I also have tried MANY combination and it is alwase showing IP and nothing else

          1 Reply Last reply Reply Quote 0
          • O
            orc4hire last edited by

            Set it to DNS, but the DNS server you have pfSense set to use has to be one that has reverse DNS entries for those IP addresses.

            In other words, if this is your home Internet connection and you set pfSense to use DNS server 8.8.8.8, that server doesn't know anything about your workstations and isn't going to be very helpful.  If you're running it in an office where there is a DNS server that has rDNS entries for the workstations, set pfSense to use that server and it should work.

            (Try this:  On your workstation open a command prompt and run 'nslookup <ip address="" of="" workstation="">'.  If that query doesn't resolve a name, your DNS server doesn't have that information about your workstations.)</ip>

            1 Reply Last reply Reply Quote 0
            • jimp
              jimp Rebel Alliance Developer Netgate last edited by

              Also, even if you have pfSense set to register DHCP hostnames in DNS, that only works for clients on the LAN side, not for pfSense services. pfSense uses the external DNS servers for resolution, and not the internal DNS forwarder.

              However, static DHCP leases and DNS overrides do work, IIRC, because they get written to /etc/hosts and are available to pfSense for that reason.

              In 2.0 I believe this has (or will) change to have all of these hosts end up in /etc/hosts so it may not be a problem in future versions.

              Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

              Need help fast? Netgate Global Support!

              Do not Chat/PM for help!

              1 Reply Last reply Reply Quote 0
              • S
                Seth last edited by

                In an environment were pfSense is the only DNS server internally I have configured pfSense to look to itself first.  This is what my config looks like.

                Services | DNS Forwarder
                check - Enable DNS forwarder
                check - Register DHCP leases in DNS forwarder
                check - Register DHCP static mappings in DNS forwarder

                System | General Setup
                DNS Servers
                1st DNS Server - 127.0.0.1
                2nd DNS Server - <your 1="" preferred="" external="" dns="" server="">3rd DNS Server - <your 2="" preferred="" external="" dns="" server="">With 1.2.3 you'll need Fit123 package. 2.0 includes a 3rd and 4th entry natively.

                uncheck - Allow DNS server list to be overridden by DHCP/PPP on WA</your></your>

                1 Reply Last reply Reply Quote 0
                • M
                  mcs last edited by

                  Seth, does your configuration work, i.e. does LightSquid resolve hostnames in report? Because I have the same problem in environment with no local DNS server, pfSense is DHCP server for LAN workstations, static DHCP is not configured.

                  1 Reply Last reply Reply Quote 0
                  • C
                    chudy last edited by

                    I would like to share this. somebody might interested.
                    pkg_add -r p5-Net-DNS
                    overwrite the file /usr/local/libexec/lightsquid/ip2name.dns with the code below.

                    #contributor: esl
                    #hacked chudy_fernandez@yahoo.com
                    #resolve hostname, cache it for speedup
                    # -- vim: filetype=perl
                    
                    use Net::DNS::Resolver;
                    
                    my $res = Net::DNS::Resolver->new(
                                   nameservers => [qw(127.0.0.1)],
                                   udp_timeout => 2,
                                   retry       => 1,
                                  #debug       => 1,
                              );
                    
                    sub StartIp2Name() {
                      my $body = ReadDHCPConfig();
                    
                      while ($body =~ m/(\#[^\n]*\n)?lease ([0-9.]*)\s?\{(.*?)\}/sig) {
                        my $tmp=$3;
                        my $ip=$2;
                        $tmp =~ m/client-hostname "(.*)"/;
                        my $comp=$1;
                    
                        if ($comp ne ""){
                            $hIP{$ip}=$comp;
                    			$id = $comp;
                    	$hRealName{$id}=$comp if ($user ne "");
                        }
                      }
                    }
                    
                    sub Ip2Name($$$) {
                    # $Lhost,$user,$Ltimestamp
                      my $ip=shift;
                      if (!defined $hIP{$ip}) {
                    
                    	if (my $pkt = $res->query($ip)) {
                    		for my $answer ( $pkt->answer() ) {
                    			my $type = $answer->type();
                    			if ($type eq "PTR") {
                    				$user = $answer->ptrdname();
                    			} elsif ($type eq "A") {
                    				$user = $answer->name();
                    			}
                    		}
                    	} else {
                    		$user=$ip;
                    	}
                    
                        $hIP{$ip}=$user;
                      }
                      return $hIP{$ip};
                    }
                    
                    sub StopIp2Name() {
                    }
                    
                    sub ReadDHCPConfig() {
                      local $/;
                      my $file;
                      open FFAAAA,"<","/var/dhcpd/var/db/dhcpd.leases";
                      $file=<ffaaaa>;
                      close FFAAAA;
                      return $file;
                    }
                    
                    #warning !!!!
                    1;</ffaaaa> 
                    

                    I add the dhcpd leased bec dns will not show the old name, when client switch lan to wlan.

                    1 Reply Last reply Reply Quote 0
                    • M
                      mcs last edited by

                      Interesting solution chiddy, could be helpful.

                      I have tried the solution of Seth and I can confirm that it works!

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post