5 Steps to Setup Static IP And FQDN to CentOS Machine

Most of the when we start to setup any kind of cluster (for Hadoop, Spark etc…) from scratch, we as a beginner often  face certain problems while performing steps (like setup Static IP address or setup FQDN) after installation of Linux flavour OS on our VM or Machine. There are very less forums where you can get all of these bazics steps together along with full understanding. Here I have tried to explain you the process of setting up static IP address and FQDN (Fully Qualified Domain Name) in 5 steps. All of these steps are tested on VM/Machine available straight after minimal installation of CentOS 6.4.

So here are the steps after you login with your root user on your machine.

Step 1: Changing Ethernet Interfaces to Configure Static IP address

First thing is to change configuration of Ethernet Interface in <em>/etc/sysconfig/network-scripts/ifcfg-ethX</em> (CentOS 6 onwards) or <em>/etc/sysconfig/network-scripts/ifcfg-emX</em> (Prior to CentOS 6). Your current configuration would look like below.

We need to do following changes to make setup Static IP.



Step 2: Setup FQDN (Fully Qualified Domain Name)

After updating Static IP address we need to map that IP to domain name in <em>/etc/hosts</em> file by adding one entry with IP address FQDN and hostname.

Step 3: Network Configuration

Add below configuration in <em>/etc/sysconfig/network</em><code> file.

Step 4: Restart Network Service

Now we are done with our configuration and in order to make those changes effective we need to restart network service using below command.

Step 5: Verification

The final step is to verify the changes using various commands.

  • Command to verify IP Address
  • Command to verify Hostname
  • Command to verify Domain Name
I hope all steps are clear enough to understand. Know more about next steps of setting up a new cluster in my further posts.


Leave a Reply

Notify of