Keep hostname while using DHCP

If you configured your system to use a certain hostname it is possible that when connecting your system to a network as a dhcp-client that your hostname will be removed.

To keep your original hostname :

Say your primary interface is : eno16777736, then

Create file [ /etc/dhcp/dhclient-eno16777736.conf ]

interface “eno16777736”
{
supersede host-name “<your original hostname>”;
}

 

Restart your network and your hostname should be remained

Leave a comment

Your email address will not be published.


*


Fix this before you comment on this post * Time limit is exhausted. Please reload the CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.