Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In linux, when my machine requests an IP address it also sends the hostname back to the DHCP server. How can I stop my machine from sending back this hostname?

I use dhclient, possibly via NetworkManager.

share|improve this question
up vote 4 down vote accepted

You can find host-name in dhcp client configuration to remove or add hostname.

For example:

Debian / Ubuntu Linux - /etc/dhcp3/dhclient.conf

$ sudo vi /etc/dhcp3/dhclient.conf

Set hostname as you need on the following line: send host-name "yourhostname";

RHEL / Fedora / CentOS Linux - /etc/sysconfig/network-scripts/ifcfg-eth0 (for 1st DHCP network interface)

Open configuration file, enter:

# vi /etc/sysconfig/network-scripts/ifcfg-eth0

Append hostname as you need on the following line :


It is also possible for NetworkManager to send the hostname; see /etc/NetworkManager/NetworkManager.conf looking for:

share|improve this answer
As a side note, I find it funny that you gave specific instructions to use vi to edit those files instead of just saying they have to be edited and letting the readers decide how to do it. Maybe they prefer nano. Suggesting vi can lead to questions like "How do I quit from Vi?" :-) – Cristian Ciupitu Jul 19 '14 at 20:32
vi came naturally :) but I agreed.. instructions could have been explained better. – Raza Jul 19 '14 at 23:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.