Fix resolving FQDN given by DHCP
authorBenjamin Drung <benjamin.drung@profitbricks.com>
Tue, 24 Apr 2018 15:54:10 +0000 (17:54 +0200)
committerBenjamin Drung <benjamin.drung@profitbricks.com>
Mon, 30 Apr 2018 12:11:00 +0000 (14:11 +0200)
commit43b5c8a4df961f5346e2ce176d6efe7495ddff14
tree3950b1d37915dda3b63c97bccbbbdedabc649168
parent8d2dac82e4d75ef257dda8304eed41b77b20bd07
Fix resolving FQDN given by DHCP

The DHCP can specify a host and domain name for the system. live-boot
fills `/etc/hostname` and `/etc/resolv.conf` with the data from the DHCP
server, but resolving the fully qualified domain name (FQDN) fails, when
the host is not specified in DNS:

```
(initramfs) hostname -f
hostname: example-host: Host name lookup failure
```

To make the FQDN resolvable without DNS, `libnss_files.so` needs to be
included in the initramfs, `/etc/nsswitch.conf` need to prefer `files`
over `dns`, and `/etc/hosts` needs to be filled with the data from the
DHCP server.
backend/initramfs-tools/live.hook
components/9990-networking.sh