How to change hostname?

tonymontana

Verified User
Joined
Dec 30, 2017
Messages
43
Hi,

I have to change hostname after install.
I went to CMD_ADMIN_SETTINGS, hostname is s.domain.com, ns1 ns1.domain.com, ns2 ns2.domain.com but it does work. What else I should do?
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
15,059
Location
GMT +7.00
Hello,

It's not clear enough what you mean under "it does not work". I would guess you see an old hostname after a server reboot, but your case might differ.

So if you still see an old hostname every time you reboot the server, it might need to connect to control panel of your server provider and change a server name there.

If you have no access to the control panel, or it for any reason does not work, then you might try and add a crontask:

1. login as root into a shell on your server
2. Use crontab -e to edit cron tasks of a super user

Code:
@reboot /usr/local/directadmin/scripts/hostname.sh [COLOR=#333333]s.domain.com

3. save changes and exit.[/COLOR]
 

tonymontana

Verified User
Joined
Dec 30, 2017
Messages
43
So if you still see an old hostname every time you reboot the server, it might need to connect to control panel of your server provider and change a server name there.

I change in control panel hostnames and save it. But when I setup new NS record in privider domain, then this don't work.
 

zEitEr

Super Moderator
Joined
Apr 11, 2005
Messages
15,059
Location
GMT +7.00
I believe you should connect as a reseller to Directadmin and update a list of nameservers there on a "Nameservers" page.
 

Active8

Verified User
Joined
Jul 13, 2013
Messages
1,497
Thank you for your copy paste solution (which is an standard hostname problem solution) on 3 years ! old topic.
 
Last edited:

Zhenyapan

Verified User
Joined
Feb 23, 2018
Messages
1,865
Location
UA
@Active8 and also hostname in DA must be modified from DA, because it modifies little more configs than just described commands..
 
Top