AlpineLinux 3.8: Install dhclient for DHCP client

This article will install dhclient for setting hostname provided by DHCP server.

1 udhcpc command

The hostname provided by DHCP server is not set.

localhost:~$ cat /etc/hostname
localhost
localhost:~$ hostname -f
localhost.hiroom2.com

2 Install dhclient

Install dhclient and reboot. The coreutils is needed for avoiding dhclient script error with busybox command.

$ sudo apk add dhclient coreutils
$ sudo reboot

The hostname provided by DHCP server is set.

kvm-alpinelinux-3-8-dhclient:~$ cat /etc/hostname
localhost
kvm-alpinelinux-3-8-dhclient:~$ hostname -f
kvm-alpinelinux-3-8-dhclient.hiroom2.com