I rebuilt a Windows 7 Workstation with CentOS 6.5. The Windows 7 had a host name aaa attached to domain ddd.local.

The new CentOS hostname is bbb. When I try to ping it:

$ ping bbb
ping: unknown host

However when I try the old host name it get the correct IP:

$ ping aaa
PING aaa.ddd.local ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=0.345 ms
64 bytes from icmp_seq=2 ttl=64 time=0.374 ms

In fact I can ssh to it using username@aaa and it works.

My /etc/hosts is:   bbb.ddd.local localhost 

My /etc/hostname is:


My /etc/sysconfig/network is:


I tried adding DNS_HOSTNAME=bbb to the ifcfg-eth0 with no success.

I have little, to possibly no access, to our companies DNS Server and any changes would have to go through a long process, something I would like to keep as the very last option.

Please let me know how I can inform the DNS server to update the hostname for the specific network Card?

2 Answers 2


The hostname you set on a give system has nothing to do with the hostname that other computers on your network know this computer by, unless you're making use of DHCP to delve out your IP addresses AND your DHCP sever is setup to communicate with your domains DNS server. I'll describe methods for setting that up down below in the Sending your hostname to DHCP section.

Why can't I ping bbb but still aaa?

If your domain is not making use of what's called dynamic DNS (this is where the clients can provide their hostnames' to the DHCP server) then there is really nothing you can do to change your hostname to IP address mapping that exists in your domains DNS server.

If you've continued to get the same lease when your system was using Windows 7 (which you should be since it's the same hardware using the same MAC address), then your DHCP server is likely continuing to use the hostname that was originally reported when you were using Win 7.

Using the method described below should get your Linux host to send its hostname if it isn't already doing so.

Sending your hostname to DHCP

If your DHCP server supports it you might want to try and have your client send the desired hostname that it wants. Add the following to the file /etc/dhcp/dhclient.conf:

send host-name 'your-hostname-here';

If you want to send a fully qualified domain name (fqdn) - myhost.mydomain.com instead of just myhost you need to add these lines too:

send fqdn.fqdn "myhost.mydomain.com.";
send fqdn.encoded on;
send fqdn.server-update off;
also request fqdn, dhcp6.fqdn;

Edit #1

The OP was asked to try the following commands and report back:

dig <hostname> @<router ip>

The OP reported that this worked so it was determined to try adding the router's IP explicitly to his dhclient.conf file.

Edit #2

It was suggested to try adding the following to the /etc/dhcp/dhclient.conf file:

prepend domain-name-servers;

Edit #3

Given you're able to now ping servers using your router's DNS server when you added, but not the internet, I would suggest you add some external DNS servers as well using the above prepend option like so:

prepend domain-name-servers,,;

This will add your router as a DNS resolver along with Google's DNS servers.


I tried adding DNS_HOSTNAME=bbb to the ifcfg-eth0 with no success.

You actually want DHCP_HOSTNAME=bbb.domain.tld in your /etc/sysconfig/network-scripts/ifcfg-eth0 file, not DNS_HOSTNAME.

You must log in to answer this question.

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