In this article we will explain how to Change the hostname in DirectAdmin. The hostname is the name you give your server. It needs to be a fully qualified domain name, meaning it needs to resolve to your server IP. If your domain is domain.com ,good values for the hostname are for example: server6.domain.com, web1.domain.com or ns1.domain.com.
NOTE: Never use “domain.com” as the hostname as this will conflict with the email in your actual domain.com hosting account (with regards to how system accounts get their emails).
Step 1: Log in to DirectAdmin
- By default DirectAdmin is listening only on port 2222, so, the access URL would be:
- http://220.127.116.11:2222/ or http://hostname.yourdomain.com:2222
Step 2: Go to Admin Level -> Admin Settings -> Server’s Hostname
Step 3: Set the hostname
Step 4: Save the changes
Save and wait for about one minute, and DirectAdmin will reflect the new hostname in the ‘Server’s hostname’ field. That’s it, you are done!
In case you get the following error :
Your hostname, , and the servername you have set in DirectAdmin, server.host.com, do not match.
a reported cause of this is an incorrectly setup /dev/null file.
Step 1: Log in with SSH as root
Step 2: Check the hostname
First make sure the hostname isn’t simply blank by checking:
to ensure you get something displayed. If you do see something, then the solution is to set it correctly:
rm /dev/null mknod -m 0666 /dev/null c 1 3
Another confirmed solution for when you get the error message:
hostname: Name or service not known
is to edit your /etc/hosts file, and change:
18.104.22.168 your.hostname.com your
So that you have both the long and short forms of your hostname besides your server IP.
We have changed the hostname of the Direct Admin control panel and also gave you some fast solutions to common issues that can occur while changing the hostname on your server.