Problems with DHCP_HOSTNAME for RHEL5 and RHEL6

Hi folks,

I have a weird problem.

I'm doing guest customization for Linux guests. During this process, I change the hostname, etc. For changing the hostname, I edit the /etc/sysconfig/network file and change the HOSTNAME field. I also add a new property called DHCP_HOSTNAME as my IP's are all DHCP based and I want my hostname to be registered in DNS.

The way I'm currently setting my DHCP_HOSTNAME is as follows:

DHCP_HOSTNAME=linuxHostname.domain.com

Now, the funny part. I'm doing the same for RHEL5 and RHEL6. It works perfectly in RHEL5.
The hostname is registered in DNS as linuxHostname.domain.com. Moreover, when I do an nslookup with the IP of this linux guest, I get the correct answer back as linuxHostname.domain.com.

But, when running with RHEL6, the name registered in DNS is linuxHostname.domain.com.domain.com !!
nslookup too returns back as linuxHostname.domain.com.domain.com

Any idea as to why this is happening?

A few points for readers:

  1. The DHCP_HOSTNAME for me has to be within this file itself. I have read some posts for adding it within the ifcfg-eth0 file, but I am not sure that is an option for me.
  2. I've seen that when I remove the .domain.com entry from the RHEL6 DHCP_HOSTNAME, the DNS name is registered correctly. i.e. as linuxHostname.domain.com

My questsion is in 2 parts:

  1. Any idea why it works with RHEL5 and not with RHEL6?
  2. Is it the right practice to add domain.com to the DHCP_HOSTNAME? Or is that the DNS's job? If I don't add the domain name, will it resolve to the correct DNS name automatically in a forest?

Do you have a domain line in /etc/resolv.conf?

Nope.
It has only a 'search domain.com' and other nameserver lines within it.

Any suggestions on this?

DNS is windows or Linux?

You already have answer to the question!! :slight_smile:

"search" is to append the domain name to your query.