I've somehow deleted /etc/hosts
on my testing system, which is Debian Sid. Now I want to install the default /etc/hosts
. I tried dpkg -S /etc/hosts
to find out which package contains /etc/hosts
, but none was found. Where can I download it from ?
The
/etc/hosts
file is written viadebian-installer
, it does not exist as a packaged file.The following is my
/etc/hosts
from a default install:For more details of the syntax see Debian Reference section The hostname resolution.
Update:
Since I feel this answer has garnered more upvotes than I had expected, I did a little finger-work for you, in return. :)
The actual package used by
debian-installer
, which contains the/etc/hosts
logic, is namednet-cfg
. More specifically, two files,netcfg.h
andnetcfg-common.c
handle the logic of building the/etc/hosts
file.netcfg.h
has#define
s for both the file itself, and the IPv6 entries:netcfg-common.c
contains the dirty work, populating the info in/etc/hosts
:Unchecked on Debian, but it should be
(if you do not use IPv6 then you can ignore the line starting with ::1)
Edit: The file is probably the base installation, not from an additional package.