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

    Squid Local DNS Patch

    pfSense Packages
    2
    3
    2.0k
    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.
    • P
      ptaylor
      last edited by

      Since my previous post, I've come up with a modification to both squid.xml and squid.inc that adds the option to force squid to use the pfSense DNS server..  Unfortunately, diff doesn't appear to be included in pfSense…

      Here's my addition to the squid.xml file, just after the field for icp_port:

                      <field><fieldname>dns_nameservers</fieldname>
                              <fielddescr>Enable Local DNS</fielddescr>
                              <description>This will force the proxy server to use the
       DNS server on pfSense to perform DNS lookups.</description>
                              <type>checkbox</type></field> 
      
      

      In the squid.inc file, here's my addition to the squid_resync_general function:

              if (($settings['dns_nameservers'] == 'on')) {
                      $conf .= "dns_nameservers 127.0.0.1\n";
              }
      
      

      That code segment goes just after the similar if statement for the transparent proxy setting.

      In case you missed my earlier post, this ensures that any DNS changes you've made in pfSense are enforced by the proxy server.  If you are overriding any zones, without this change and that item checked, your overridden zones will be bypassed by proxy clients.

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

        Problem access to 127.0.0.1 from squid in transparent mode exists. May be need use Lan IP? But may be bug if you change Lan IP - also will be need change squid.conf

        SquidGuardDoc EN  RU Tutorial
        Localization ru_PFSense

        1 Reply Last reply Reply Quote 0
        • P
          ptaylor
          last edited by

          What's the issue accessing 127.0.0.1 from squid while it is in transparent mode?

          This is working for me at the moment.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.