I want to send to different networks dhcp servers different hostnames. Can this easily be done?
This should be able to be achieved by NM writing a specified hostname to the merge dhclient config written to /var/run/nm-dhclient-.conf. The "send host-name ..." line in this config is generated at src/dhcp-manager/nm-dhcp-dhclient-utils.c in function nm_dhcp_dhclient_create_config. Tracing the call chain up, it appears as though the hostname argument of this function comes from the NMSettingIP4Config argument in function nm_dhcp_manager_start_ip4 file src/dhcp-manager/nm-dhcp-manager.c. But I don't see where the NMSettingIP4Config get filled in. Figuring out where that comes from would tell us how easy it would be to do this.