what populates /etc/hosts

Started by user1234, November 21, 2023, 10:49:02 PM

Previous topic - Next topic
On my opnsense install the /etc/hosts file has a single entry for the firewall but I can't work out how it selects which address to use.

root@firewall:~ # cat /etc/hosts
127.0.0.1       localhost       localhost.home
::1             localhost       localhost.home
192.168.2.254   firewall        firewall.home


My firewall has 8 vlans with IPs on and it appears to select one to put into the hosts file.
Is there a way to influence which IP address is used?

part of the OS (freebsd).
you can read:
man hosts
man inet