Change hostname in DirectAdmin

Estimated reading time: 1 min

Introduction

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).

Prerequisites:

Step 1: Log in to DirectAdmin

  • By default DirectAdmin is listening only on port 2222, so, the access URL would be:
  • http://12.34.56.78:2222/ or  http://hostname.yourdomain.com:2222

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, 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:

  • /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:

1.2.3.4   your.hostname.com

to be:

1.2.3.4   your.hostname.com your

So that you have both the long and short forms of your hostname besides your server IP.

Conclusion

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: 2096

Reader Interactions

Leave a Reply

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