1

Topic: My FQDN mail.mydomain.com is changed to mydomain.com

Hello,

I did this

# File edited and saved: /etc/hostname
mail

# File edited and saved: /etc/hosts
127.0.0.1   mail.mydomain.com mail localhost localhost.localdomain

Verify the FQDN hostname:

first time
# hostname --fqdn
mail.mydomain.com

second time,
# hostname --fqdn
mydomain.com

It was changed ?????????????????


I do not know how, but it changed the FQDN to mydomain.com

Now the host file is

File /etc/hosts
127.0.0.1   mydomain.com mail localhost localhost.localdomain

I have tried to fix it many times but it always return to
127.0.0.1   mydomain.com mail localhost localhost.localdomain

what can I do in order to solve the problem?

Thanks

Peace5

2

Re: My FQDN mail.mydomain.com is changed to mydomain.com

the hostname change need restart machine.

if you donot want to restart machine

hostname mail.domain.com

3 (edited by Peace5 2009-10-09 16:43:36)

Re: My FQDN mail.mydomain.com is changed to mydomain.com

Thanks for your reply.

I only have this in my VPS: ubuntu-8.04-i386-minimal

I did this

# hostname mail.mydomain.com

# hostname --fqdn     
# mail.mydomain.com         (this is ok)

=======> After that I reboot the VPS and I got this:.

# hostname --fqdn     
# mydomain.com               (this is wrong)

File /etc/hosts   

127.0.0.1 localhost.localdomain localhost
# Auto-generated hostname. Please do not remove this comment.
xxx.xxx.xxx.xxx mydomain.com mydomain

File /etc/hostname
mydomain.com

I have a power panel HyperVM. Do I have to fix it at the Power Panel HyperVM?
if yes, how ?

Here is the problem:
If I reboot the VPS, host and hostname files will be Auto-generated
What can I do?

Thanks

4

Re: My FQDN mail.mydomain.com is changed to mydomain.com

Does your VPS restrict this? Does it allow user change it?

5

Re: My FQDN mail.mydomain.com is changed to mydomain.com

Yes my VPS allow to change the domain to anyone:

from mydomain.com to anything.com

Please check my previous reply above I just updated

6

Re: My FQDN mail.mydomain.com is changed to mydomain.com

http://www.webhostingtalk.com/showthread.php?t=620295

If you change hostnames on a Virtuozzo/OpenVZ VPS, you should also ensure that your host has updated the hostname from their side as well...else your hostname will be reset the next time your VPS reboots. There are ways around that too, but its simpler just provide your host with the up to date info.

so if you want to change the hostname, you need contact the service provider.

7

Re: My FQDN mail.mydomain.com is changed to mydomain.com

I did this:

HyperVM Control Power Panel>Network>Hostname>mail.mydomain.com

File etc/hosts   

127.0.0.1 localhost.localdomain localhost
# Auto-generated hostname. Please do not remove this comment.
xxx.xxx.xxx.xxx mail.mydomain.com  mail mydomail.com mail

File etc/hostname   
mail.mydomain.com   

it should be mail,  is this wrong?

8

Re: My FQDN mail.mydomain.com is changed to mydomain.com

I think you'd better to contact your VPS provider, they will tell you the best and correct way to change hostname on your VPS.

9

Re: My FQDN mail.mydomain.com is changed to mydomain.com

It seems that it is working

You should consider to include this at the tutorial:

HyperVM Control Power Panel>Network>Hostname>mail.mydomain.com