Headlines
Loading...
How to Change Domain Name in Linux server (Quick Guide) 2020

How to Change Domain Name in Linux server (Quick Guide) 2020

Linux is open-source software means that you can easily change anything in Linux and readjust it in your domain name. The Linux source code is easily and freely available for everyone.

change domain name in linux
change-domain-name-in-linux-server  


Many companies have a personal domain for their IT support, and it needs servers to be configured with a domain name. It will assure all Linux cheap and best hosting servers will have FQDN (Fully Qualified Domain Name).

For example, the server12 is hostname and server12.kerneltalks.com is its FQDN. In such a setup, monitoring requires the servers to be recognized by FQDN only.
So, you have to configure the domain name for your Linux server. Below are some steps that are necessary to set up a domain name on a Linux server.

The Setup Domain Name in Linux server - 

Now, we will describe the steps to set domain names in Linux. It is not as hard as you might think, especially because you can do it in a few steps.

Before change domain name in Linux, check your server is having domain name already setup or not, execute the following two lines of code:

root@server21#dnsdomainname
xyz.com

If your output like above code then your server is configured with a domain name and you get output is blank then you need to set up the setup domain name for your Linux server. Follow the below steps to configure your domain name.

Now, we described how to set up the setup domain name in Linux Server. It is not as hard as you might think, especially because you can do it in a few steps.
Before anything else check your server is having domain name already setup or not using the command, given below:
root@server21# dnsdomainname
xyz.com
If your output like above code then your server is configured with a domain name. If your output is blank then you need to set up a domain name for your vps linux kvm server. Follow the below steps to configure your domain name

Step-1]: Setup FQDN in Linux server

The FQDN (fully qualified domain name) is a complete domain name for a specific computer, or host, on the internet. It consists of two-part such as hostname and domain name. First of all, add the FQDN to your hostname in /etc/hosts file.

root@server12 # cat /etc/hosts
10.10.2.32 server12. xyz.com server12

The /etc/hosts file is an operating system file that translates hostnames or domain names to IP addresses, also is useful for testing website changes. Verify your FQDN and run the following two lines of code.

root@server12 # hostname -f
server12. xyz.com

The -f is used to get the fully qualified domain name (FQDN), which contains the short hostname and DNS domain name. Once you confirm your FQDN then your output should be a hostname. domain 

Step - 2]: Check Domain name of Linux Server

Let's start the process of the check domain name of the Linux server. First, confirm that changes are working correctly or not. The following are the commands to check hostname, FQDN and domain name of your server.

root@server12 # hostname
server12
root@server12 # hostname -f
server12. xyz.com
root@server12 #dnsdomainname
xyz.com

It was the last step to set the domain name in Linux. In the next section, we will cover all basic Linux commands used in the above code to change domain name in Linux server.

The Basic Linux Commands for Beginners

The basic command used in the above code for changing the domain name in Linux. Following are some of the basic Linux commands you’ll need to know.
 
  1. Hostname –f: The hostname -f command shows your FQDN and dnsdomainname command shows your domain name of Linux server.
  2. Hostname –d: You can use hostname -d command to get the domain if local domain name is set.
  3. Domain name-command: The domain name command in Linux is used to deliver the Network Information System (NIS) domain name of the host. 
  4. Hostname: The hostname command is used to obtain the DNS (Domain Name System) name and set the system hostname. The hostname is a name given to a computer, and it is attached to the network.
 
If the hostname command executes without any options, this will show the current hostname and your domain name of the Linux system.
 
A domain name is registered in the DNS server when the position of a local network. If the DNS server does not present, you can enter the entry in /etc/hosts file to map the IP address including the domain name.

Conclusion:

In this article, we explained all steps that needed to change the domain name in the Linux server and also described some basic commands that are used in Linux server to configure a domain name.
In short, there are some basic commands that everyone needs to know: hostname -f command, nsdomainname command, /etc/hosts file, domain name command, hostname command.
All the steps of changing the domain name in Linux are easy to understand. Hence there is no need to use a different method to a set domain name in cheap reseller web hosting Linux.

0 Comments: