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

    PfSense nslookup - local IP instead of public IP???

    Scheduled Pinned Locked Moved DHCP and DNS
    4 Posts 4 Posters 2.4k Views
    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.
    • R
      rgerbranda
      last edited by

      Our pfSense is configured with a public IP and a public A record (pfsense.ourdomain.nl)

      When I query the DNS on the pfSense server, with the FQDN of the A record, the local IP is returned!?!!

      Why does pfSense replace the public IP by the local IP?
      Is it possible to stop this?

      1 Reply Last reply Reply Quote 0
      • JKnottJ
        JKnott
        last edited by

        As I understand it, there are 2 ways pfSense can know your local address, you specifically configure it in resolver/forwarder or you configure the dhcp server to accept the host name and then pfSense can use it for DNS lookup.

        BTW, why wouldn't you want to use the local address on the local network?

        PfSense running on Qotom mini PC
        i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
        UniFi AC-Lite access point

        I haven't lost my mind. It's around here...somewhere...

        1 Reply Last reply Reply Quote 0
        • K
          kpa
          last edited by

          "Services->DNS Forwarder->Register DHCP leases in DNS forwarder" if you're using the DNS Forwarder, "Services->DNS Resolver->Register DHCP leases in DNS forwarder" if using the DNS Resolver. Turning the option off will stop pfSense from registering the local addresses from DHCP leases as local overrides.

          However, you probably don't want to do that because your local LAN clients would then try to access other LAN hosts by their public IP addresses and that requires more complicated methods (NAT reflection) to work. What you should do when querying the addresses from the pfSense command line is to use a public DNS such as the google DNS at 8.8.8.8:

          
          dig @8.8.8.8 myhost.ourdomain.nl
          
          
          1 Reply Last reply Reply Quote 0
          • KOMK
            KOM
            last edited by

            Is it possible to stop this?

            Why would you want to?  You get the same result regardless and it is more efficient.

            https://doc.pfsense.org/index.php/Why_can%27t_I_access_forwarded_ports_on_my_WAN_IP_from_my_LAN/OPTx_networks

            You are already using method #2 which is the more elegant solution.

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