Hostnames are automatically obtained in one of two ways:
DHCP - When the NGFW is the DHCP server we get the hostname as part of that negotiation. This is the most effective way for auto-populating this field.
Reverse DNS Lookup - When NGFW is not handling DHCP, we perform a reverse DNS lookup on an IP when we first see it. This generally only works properly if you have an internal DNS server that is defined under Config > Network > DNS Servers.Follow