Unbound preferred hostname for the ptr in host overrides
-
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. -
@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.
-
@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! -
@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.