Is it possible to override the automatically created firewall hostname dns entry?
In pfSense General Setup you can set a hostname and domain for the firewall (Reference). For example:
pfSense seems to automatically add a line to
/etc/hostswhich maps this hostname + domain combination to the ip address of the LAN interface (specifically the interface pfsense considers to be LAN).
Example of the line it adds after the loopback entries:
10.1.1.1 pfsense.mynet.localdomain pfsense
Additionally, for Unbound specifically,
/var/unbound/host_entries.confgets two lines which expresses the same association:
local-data-ptr: "10.1.1.1 pfsense.mynet.localdomain" local-data: "pfsense.mynet.localdomain. A 10.1.1.1"
As a consequence of this, when trying to resolve
pfsense.mynet.localdomainwith the pfSense as the DNS server, the ip address which is returned is
10.1.1.1, as expected.
My issue is that I want to override this to a different ip address. For example, I have a VLAN on another interface which is used for network device management. It has the subnet
10.2.1.0/24and the IP address of the interface itself is
It seems not possible to override the default entry that pfSense sets up with respect to the hostname+domain of the firewall. Adding a DNS Resolver host override for
pfsense.mynet.localdomainto resolve to
10.2.1.1just adds another item to the aforementioned files.
The result of that is that when resolving
10.2.1.1are returned as answers (at which point the client system may decide to use the former, which I don't want).
Is it possible to force the firewall's registered hostname+domain to resolve to something other than the LAN interface ip address? Is the only solution to this to edit the files by hand?
Thanks for any advice that you have.
FWIW I use a VIP / loop back for this type of thing.
I see, thanks for sharing I guess I'll give it a shot. Perhaps future versions of pfSense will have more flexibility as well.
I have exactly the same issue.
I have several interfaces, LAN, LAN_APP, DMZ_RP, DMZ_PS4.
When I ping firewall.home, the IP returned is the interface of LAN_APP (10.0.7.254). How is this IP chosen by pfsense?
I tried to rename interfaces, but this doesn't change.
jahonix last edited by
@giminik You can assign subdomains at the interface's DHCP server tab.
Domain name: "The default is to use the domain name of this system as the default domain name provided by DHCP. An alternate domain name may be specified here."
So you can end up with
-firewall.home or firewall.lan.home