Changing hostname does not update hosts file

When changing the hostname on Debian 9 the hosts file is not updated. There is an entry in /etc/hosts for the ip number: name

This is correctly set when first installing the server, but not updated when changing the hostname from webmin. I haven't found any impact on my server, but is probably best to make sure the hostname in in the hosts file is updated correctly.

See also Debian documentation:



Although the documentation says that with a fixed ip number that number should be in the hosts instead of the I am a bit confused what is the best practice here. Maybe this should not be a bug rapport, but an forum question instead.

Actually, as long as you have the box checked on the Hostname and DNS Options page to update the hosts file entry, and the hosts file has a line for the old hostname, it should be updated.