NetworkManager modifies /etc/hosts

There is an annoying bug (or feature depends on point of view) every restart/reconnect managed by NetworkManager, restore the original /etc/hosts loaded on startup. I’ve made a 3 line script inspired by visudo to manual edit the hosts file and prevent the other unexpected modifies: File like (with +x attribute): /usr/sbin/vihosts #!/bin/sh sudo chattr -i /etc/hosts sudo vim /etc/hosts sudo chattr +i /etc/hosts

26 November 2011 @ 22:09 · Updated: 30 June 2026 @ 03:28 · leo