For years I'm using Ubuntu (currently on 18.10) to develop PHP applications on domains like foo.bar.localhost
for local testing. These domains were resolved to 127.0.0.1 and handled by Apache 2.4. This always worked. The line 127.0.0.1 localhost
is in my /etc/hosts
like it always was.
Today morning I turned my device on and this did not work anymore. ping localhost
is still working, but ping foo.bar.localhost
is not (it still was working yesterday). Surprisingly Chromium is still resolving foo.bar.localhost
, I assume it's not using the OS for DNS resolving. But I'm mainly using Firefox, which also stopped resolving localhost subdomains.
I didn't change any system-related settings yesterday, but I remember some package updates from yesterday, so I assume there were some changes to some network-related things. Is there any way to get dpgk
to list install/update dates so that I can find out the exact packages that were updated?
What settings could I check to make resolving subdomains work again system-wide? Are there any known bugs?
Additional information: In /var/log/dpkg.log
I found a recent entry upgrade resolvconf:all 1.79ubuntu10 1.79ubuntu10.18.10.1
which sounds relevant. This and the following subsequent lines are the only lines containing the term "resolv" (found with cat /var/log/dpkg.log | grep resolv
). So, in the last hours this DNS-relevant package was updated.
Another information: the manual man systemd-resolved
has the following line:
The hostnames "localhost" and "localhost.localdomain" (as well as any hostname ending in ".localhost" or ".localhost.localdomain") are resolved to the IP addresses 127.0.0.1 and ::1.
So this well-defined behaviour stopped working. I also can not remember changing anything related to this lowlevel DNS stuff myself.
The exact message when doing ping foo.bar.localhost
is
ping: foo.bar.localhost: Name or service not known
Apparently the only bug "fixed" in the new version of resolvconf was this: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1817903 which is related to local resolving.
The problem was having
resolveconf
installed at all alongsidesystemd-resolved
. I removed it byapt-get purge resolvconf
with root rights. Then everything worked again.I assume having both installed was a left-over from some previous major version update between Ubuntu releases, which now triggered this strange behaviour.