DHCP Client #
To use dhclient(8), edit the hostname.if(5) file of your interface. The wireless networking section explains how to set up wireless interfaces. For ethernet interfaces, one line is enough: Setting up a machine to use DHCP for its network configuration is done in the hostname.if file found in /etc/. Simply add the following line to /etc/hostname.if, where “if” is the name of the network interface you’d like to enable DHCP on.
Enabling DHCP like this will allow the system to receive its IP address, default gateway, and DNS servers once the interface is brought up, usually during startup and after running
It’s also possible to run the DHCP client manually.
Replace re1 with your interface name.
It’s possible to ignore or complement certain values received from the DHCP server. These options/values can be configured in /etc/dhclient.conf. For example, it’s possible to overwrite the name server configuration by using the following line.
supersede domain-name-servers 188.8.131.52;
In this case, the Cloudflare nameserver will be used.
Lastly, it’s possible to append additional information to /etc/resolv.conf by using a file called /etc/resolv.conf.tail.