Sheldon

Well-Known Member
Jun 7, 2004
378
0
166
Canada
ok.. I changed my server hostname via the whm server "change hostname" now I had 50 million problems with this.. 1. it never stuck after reboots etc. 2. I had problem with the dns and crap for it.

so anyhow I finally get it working and such.

but now I notice that the old hostname is still resident somewhere on the server....as when I look at bandmin and other places I still see it in the place where my new hostname should be?

any suggestions?
 

zentity

Well-Known Member
Jun 16, 2004
78
0
156
Login as root to your server:

# hostname new.hostname.com

Edit the following files

/etc/sysconfig/network

/etc/hosts

Enter your new hostname in each.

Then replace the old hostname within httpd.conf

/usr/bin/replace 'old.hostname.com' 'new.hostname.com' -- /usr/local/apache/conf/httpd.conf

Restart apache and exim - Make sure dns resolves and that any PTR records as necessary have been added for the new hostname :)

That should do it.
 

zentity

Well-Known Member
Jun 16, 2004
78
0
156
PTR is a reverse dns record, you should have one for the mail server IP (usually your main IP)

See what yours is by

# host 123.123.123.123

(Replace 123.123.123.123 with your main IP)

You should see

# host 123.123.123.123
123.123.123.in-addr.arpa domain name pointer your.hostname.com.

If you see

# host 123.123.123.123
Host 123.123.123.in-addr.arpa not found: 3(NXDOMAIN)

Then ask your datacenter or provider to create a reverse dns record for your hostname :)

Hope this helps.
 
Last edited:

zentity

Well-Known Member
Jun 16, 2004
78
0
156
Thats not good either - It looks like a provider error with regards the PTR record - Let them have the output of that command and ask them to add a reverse dns record (PTR) for your new hostname with your main IP - You will then have no trouble sending mail to mail servers that require reverse dns (AOL for one) :)
 

zentity

Well-Known Member
Jun 16, 2004
78
0
156
Not a problem. :)