Chdev hostname change is not permanent

Dear Gurus,

I have an AIX 7.1 box whose hostname is set to turtle.domain.com (FQDN) and I'm trying to change it to turtle. I'm using the below command for this:

chdev -l inet0 -a hostname=turtle 

On running this, the hostname changes to turtle but once i reboot the machine, FQDN is back.

I looked for other files that may be sending this hostname but nothing showed up.

Help, please..

Hi,

You'll probably have to change the name in the "/etc/hosts" file as well.

Regards

Dave

1 Like

Dave,

This machine is on DHCP and /etc/hosts file has no hostname entry.

pocodot

Hi,

Then I think you'll have to ensure that the DHCP ticket (lease) has the correct format, or you could just run;

smitty hostname "newname"

Once the server is up.

Regards

Dave

Hi Dave,

I've already tried smitty hostname. The original hostname still shows upon reboot. I'm thinking the DHCP server might be pushing this name. Is there a way i can verify that?

Thanks,
pocodot

nslookup <myhostname> 

Of course if you get the IP from DHCP ir will be difficult to not reset after each reboot...
I was wondering what about in /etc/hosts after localhost (or before?) (on the same line ...)

There are some instructions here that might help...
IBM Change System's Hostname in AIX - United States