Solved Hostname Change

sufiyanshaikh

Verified User
Joined
Aug 14, 2019
Messages
185
Hello,

I changed my hostname by following: https://help.directadmin.com/item.php?id=405
I have even restarted the server but still, I am facing 1 issue

Old hostname: server10.example.com
New hostname: server15.example.com

Dashboard > Admin Settings > Server's Hostname (It has the new value now showing correctly server15.exampe.com)

CustomBuild > Edit Options > redirect_host (it is still showing old value server10.exampe.com)
I tried to change it y leaving it 'blank' but getting an error (Screenshot attached)

Also when logging in SSH, getting the old hostname
------------------------
Server : XXXXXXX
IPv4 : XX.XX.XX.XX
IPv6 : XXXXXXX
Hostname : server10.example.com
----------------------

Can anyone please help?
directadmin.conf value.
servername=server15.example.com
ssl_redirect_host=server15.example.com
 

Attachments

  • hostnameerror.png
    hostnameerror.png
    47.6 KB · Views: 12
Hello,

I changed my hostname by following: https://help.directadmin.com/item.php?id=405
I have even restarted the server but still, I am facing 1 issue

Old hostname: server10.example.com
New hostname: server15.example.com

Dashboard > Admin Settings > Server's Hostname (It has the new value now showing correctly server15.exampe.com)

CustomBuild > Edit Options > redirect_host (it is still showing old value server10.exampe.com)
I tried to change it y leaving it 'blank' but getting an error (Screenshot attached)

Also when logging in SSH, getting the old hostname
------------------------
Server : XXXXXXX
IPv4 : XX.XX.XX.XX
IPv6 : XXXXXXX
Hostname : server10.example.com
----------------------

Can anyone please help?
directadmin.conf value.
servername=server15.example.com
ssl_redirect_host=server15.example.com
You are gonne need to rerun the force SSL command.
/usr/local/directadmin/directadmin set ssl_redirect_host your.hostname.com
service directadmin restart
 
You are gonne need to rerun the force SSL command.
/usr/local/directadmin/directadmin set ssl_redirect_host your.hostname.com
service directadmin restart
Getting the below error:

Error with the current values:
Cannot find 'ssl_redirect_host' in the directadmin.conf
 
Getting the below error:

Error with the current values:
Cannot find 'ssl_redirect_host' in the directadmin.conf
You could try:
cd /usr/local/directadmin/custombuild
./build rewrite_confs
And then rerun it. Do note that this will override EVERY config that it has.
 
You could try:
cd /usr/local/directadmin/custombuild
./build rewrite_confs
And then rerun it. Do note that this will override EVERY config that it has.
Still same error

Error with the current values:
Cannot find 'ssl_redirect_host' in the directadmin.conf
 
Still same error

Error with the current values:
Cannot find 'ssl_redirect_host' in the directadmin.conf
Could you try to manually add it to the directadmin.conf and then restart directadmin?
Just to see what happens.
 
I have manually set the values already and also mentioned that in the post.


not sure what is causing issue
I understand that but for DirectAdmin/CustomBuilds it just says that you did not have that value.
And are you on the latest release?
 
I am using latest pre-release version of DA
Oke then that is also not the issue.
But to be honest with you, why did you not just do a server reset and reinstall of DA?

DirectAdmin is very strict in what will work and what not. But it does not like changes like these. And may (like in your case) brake (possibly) beyond repair.

If possible I would recommend creating a system backup and do a full reinstall.
 
Oke then that is also not the issue.
But to be honest with you, why did you not just do a server reset and reinstall of DA?

DirectAdmin is very strict in what will work and what not. But it does not like changes like these. And may (like in your case) brake (possibly) beyond repair.

If possible I would recommend creating a system backup and do a full reinstall.

Well. I don't think that anyone will reset the server and reinstall DA just to change the hostname.
I will wait until someone replies with a solution :)

As per my experience, changing hostname will not break anything until someone mess up with DNS records
 
Well. I don't think that anyone will reset the server and reinstall DA just to change the hostname.
I will wait until someone replies with a solution :)
No problem. The reason I am telling it in this case is that it looks to me like something went wrong big time. (I would not tell someone to just reset there install because the hostname changed. But if DirectAdmin is not doing what you expected it to do then i do recommend a reset just to be safe.)
Since the commands that i gave you should have worked. (These are even the commands that are in the documentation on how to do this.)

And here are the docs i used to get the commands i case there hepfull:
 
No problem. The reason I am telling it in this case is that it looks to me like something went wrong big time. (I would not tell someone to just reset there install because the hostname changed. But if DirectAdmin is not doing what you expected it to do then i do recommend a reset just to be safe.)
Since the commands that i gave you should have worked. (These are even the commands that are in the documentation on how to do this.)

And here are the docs i used to get the commands i case there hepfull:

I really appreciate your help realcryptonight :)
Luckily server is UP and running fine.
The only issue is the issue I mentioned above(I have not noticed anything that has been broken due to hostname change).

I again thank you for your help and I will update this post once I have a proper solution
 
 
Thanks for your reply Active8 but the post doesn't seem to be related to the issue I am facing.
 
Did you read the whole thread? its not 1 on 1 your problem but their are similarity like :
Yes. I did read the full thread.
First, it was about changing the hostname which was done by DA Control Panel. (I already did the same way https://help.directadmin.com/item.php?id=405)
Later he had some DNS level issue so they fixed it (I don't have DNS level issue).


I think there is some misunderstanding with the post so I request you to read my issue again to know where exactly I am facing the issue.
I really appreciate your reply and help Active8
Hello,

I changed my hostname by following: https://help.directadmin.com/item.php?id=405
I have even restarted the server but still, I am facing 1 issue

Old hostname: server10.example.com
New hostname: server15.example.com

Dashboard > Admin Settings > Server's Hostname (It has the new value now showing correctly server15.exampe.com)

CustomBuild > Edit Options > redirect_host (it is still showing old value server10.exampe.com)
I tried to change it y leaving it 'blank' but getting an error (Screenshot attached)

Also when logging in SSH, getting the old hostname
------------------------
Server : XXXXXXX
IPv4 : XX.XX.XX.XX
IPv6 : XXXXXXX
Hostname : server10.example.com
----------------------

Can anyone please help?
directadmin.conf value.
servername=server15.example.com
ssl_redirect_host=server15.example.com
 
CustomBuild > Edit Options > redirect_host (it is still showing old value server10.exampe.com)
I tried to change it y leaving it 'blank' but getting an error (Screenshot attached)
You cant leave it blank
Put the correct Hostname in.
then mark yes or no to the
use_hostname_for_alias
and
redirect_host_https
questions
hit save
What happens?
 
You cant leave it blank
Put the correct Hostname in.
then mark yes or no to the
use_hostname_for_alias
and
redirect_host_https
questions
hit save
What happens?

Tried your steps.
Results.
1) When added server15.exampe.com under 'redirect_host' the value becomes server15.example.comserver10.example.com after save
2) When kept 'redirect_host' BLANK, the value becomes server10.example.com after save

It's like 'redirect_host' has value server10.example.com stuck with it and will not go no matter how hard I try to change values.
 
Ok , time to find out the root cause then:

1. is it an VPS or Dedi ?
2. what is the OS of the server ?
 
Back
Top