keep /etc/hosts up to date (dhcp)
by Ninguém from LinuxQuestions.org on (#5ENWJ)
I notice /etc/hosts has a line with current IP address and hostname and possible domain just after localhost.
Code:127.0.0.1 localhost localhost.localdomain
192.168.1.22 myhost myhost.example.comHow do you keep it correct when getting its IP address from DHCP (since it changes)?
I'm using debian, by the way.


Code:127.0.0.1 localhost localhost.localdomain
192.168.1.22 myhost myhost.example.comHow do you keep it correct when getting its IP address from DHCP (since it changes)?
I'm using debian, by the way.