Change hostname in DirectAdmin

Estimated reading time: 1 min


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 ,good values for the hostname are for example:, or

NOTE: Never use “” as the hostname as this will conflict with the email in your actual 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:
  • or

Step 2: Go to Admin Level -> Admin Settings -> Server’s Hostname

Step 3: Set the hostname

hostname in DirectAdmin

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!

Troubleshooting guide

In case you get the following error :

Your hostname, , and the servername you have set in DirectAdmin,, 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:

  • /bin/hostname --fqdn

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:

to be: 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.

Was this article helpful?
Dislike 0
Views: 1683

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *