4

Ubuntu sends my computer's configured hostname to any DHCP server it tries to use. How do I stop it from sending a hostname?

3
  • What 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>";`
    – Rinzwind
    Oct 24, 2013 at 12:37
  • @Rinzwind, I'm using whatever the standard Ubuntu client is. It appears that there's an /sbin/dhclient which is probably it with a version isc-dhclient-4.2.4. While there's no /etc/dhcp3, there is an etc/dhcp/dhclient.conf with a comment Configuration file for /sbin/dhclient, which is included in Debian's dhcp3-client package. and with the line send 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?
    – Olathe
    Oct 24, 2013 at 12:46
  • I would assume yes :D (sorry, can not test it because I only have access to production servers at the moment ;) ).
    – Rinzwind
    Oct 24, 2013 at 12:58

1 Answer 1

3

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 = ;

3
  • Is there a way to get it to send no host name rather than a custom one?
    – Olathe
    Oct 24, 2013 at 13:28
  • @Olathe edited last ,: 0
    – Raja G
    Oct 24, 2013 at 13:30
  • This 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.
    – WesDec
    Mar 6, 2014 at 14:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .