The /etc/resolv.conf and /etc/hosts files are updated by multiple scripts including:
- "system host-name" script
- "system static-host-mapping" script
- DHCP client script
The current solution is a DHCP client mode in host_name.py that allows that script to be called either at commit time or from the DHCP client script. The problem is that it's not a solution: despite complicated logic for updating the data without removing anything, it creates either data loss or a data race.
Typical example of a troublesome situation is when an interface is configured to use DHCP and host name is set in the same commit. This leads to T1540 and similar nasty situations.
A better solution would be to have a single process responsible for updating those files that maintains a message queue so that updates can be done asynchronously.