How can I stop sending my hostname via DHCP?
5,230
you can do it.
send host-name = gethostname();
This statement actually getting the host name of the system from the return value of function.
you can set it manually to some other name if you want.
send host-name =olathe ;
to send no host name: send host-name = ;
Related videos on Youtube
Author by
Olathe
Updated on September 18, 2022Comments
-
Olathe over 1 year
Ubuntu sends my computer's configured hostname to any DHCP server it tries to use. How do I stop it from sending a hostname?
-
Rinzwind over 10 yearsWhat is the version of your dhcp client? If
dhcp3
see the config in ` /etc/dhcp3. It has a setting like this
send host-name "<hostname>";` -
Olathe over 10 years@Rinzwind, I'm using whatever the standard Ubuntu client is. It appears that there's an
/sbin/dhclient
which is probably it with a versionisc-dhclient-4.2.4
. While there's no/etc/dhcp3
, there is anetc/dhcp/dhclient.conf
with a commentConfiguration file for /sbin/dhclient, which is included in Debian's dhcp3-client package.
and with the linesend host-name = gethostname();
. Would commenting out that line stop it or do I have to change it to something to avoid it doing something like sending a default hostname if there's nothing configured? -
Rinzwind over 10 yearsI would assume yes :D (sorry, can not test it because I only have access to production servers at the moment ;) ).
-
-
Olathe over 10 yearsIs there a way to get it to send no host name rather than a custom one?
-
mx7 over 10 years@Olathe edited last ,: 0
-
WesDec about 10 yearsThis does not seem to work in ubuntu 12.10. I tried to set "send host-name = ;" in "etc/dhcp/dhclient.conf" but my hostname is still sent.