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

    Unbound preferred hostname for the ptr in host overrides

    Scheduled Pinned Locked Moved DHCP and DNS
    4 Posts 2 Posters 478 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.
    • D
      darcey
      last edited by

      If I create a host override with multiple hostnames, which hostname does pfsense use to create the local-data-ptr record?

      It seems, whatever order I list hostname entries in a host override, the same hostname is preferred for the PTR record.
      I'd assumed it would be the primary 'Host' field that would be used, but this seems not the case.
      The generated local-data-ptr in /var/unbound/host_entries.conf seems to prefer the hostname that has the same domainname as the firewall itself.

      Bob.DigB 1 Reply Last reply Reply Quote 0
      • Bob.DigB
        Bob.Dig LAYER 8 @darcey
        last edited by

        @darcey I don't know but you can create your own in unbound Custom options if you need one.

        server:
        local-data: "abc.de. IN MX 10 mail.abc.de."
        local-data-ptr: "192.168.9.30 mail.abc.de."
        

        Hint: It is the second one. 😉

        D 1 Reply Last reply Reply Quote 0
        • D
          darcey @Bob.Dig
          last edited by darcey

          @Bob-Dig Cheers. I may do that. I guess I would have to create all the host entries for that IP and dispense with the GUI for that one, otherwise I would end up with two PTRs for the same IP.
          Still, it would be good to know what criteria the pfsense configurator uses to pick the host for the ptr. It's not the first entry, and it's not alphabetic. I discovered that much!

          D 1 Reply Last reply Reply Quote 0
          • D
            darcey @darcey
            last edited by darcey

            @darcey Looking at unbound_add_host_entries() and unbound_generate_zone_data() in /etc/inc/unbound.inc:
            If I am not mistaken, dns records are first generated for hostnames that have the system domain. Therefore, the ptr will always be assigned the first hostname encountered with a system domain. If so, that explains the behaviour I see and the order of entries in /var/unbound/host_entries.conf.

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