Which service/process fills the default value of /etc/hosts?
I'm running a custom OS based on ubuntu 18.04. I've ran into a problem - when the machine gets installed it sometimes doesn't have the value "127.0.1.1 hostname" in /etc/hosts. So it can't resolve itself
Does anyone know what fills that data or can you suggest where I can start debugging from ?
Solution 1:
On Debian, /etc/hosts
comes from debian-installer
and not owned by any package in particular. I have not confirmed Ubuntu, their development process a little complicated, and I don't wish spend more than a few minutes tracking down the sources.
$ dpkg --search /etc/fstab
dpkg-query: no path found matching pattern /etc/fstab
For a sysadmin, copy your desired configuration file, regardless of what the distro installer did. localhost is one of the few things it makes sense to have local files overriding what DNS says. But put records for localhost in DNS anyway.
127.0.0.1 localhost
::1 localhost