There is always a place where data is stored on a computer machine. Different types of data have different files in which they are stored. A file is a medium for storing data on computers. Ubuntu 20.04 is a type of Linux operating system that will be used in this article to store configuration data. Configuration data is stored in configuration files in Linux, which will be discussed in detail in this article.
The concept of configuration files, which include other files, is not new. Since the beginning, you’ve had the option of putting those included files in subdirectories. A configuration file defines the characteristics, choices, settings, and preferences applied to operating systems, infrastructure devices, and applications in an IT environment. It is sometimes abbreviated as “config file.” Some applications include a GUI for creating, modifying, and verifying the syntax of their configurations. System administrators may be asked to generate and alter files with the help of a text editor for other programs, which is doable because many are plain text files that can be edited by humans.
There are multiple types of configuration files on Ubuntu, which will be discussed in detail in this article.
Configuration Data Stored on Linux
Configuration data in Linux is stored in configuration files, and some of the files are mentioned below:
- Network-script configuration files
- Interface configuration files
- Dhclient configuration files
- Host configuration files
- Sysctl configuration files
All these configuration files are discussed in detail below.
Configuration Data Stored in Network Script Configuration File
A network-script configuration file in Linux controls a network interface. In the network-scripts directory, for every interface, the configuration parameters for a certain device or virtual- interface are stored and modified in a config file. Linux utilizes distinct config files for every network interface to hold IP addresses and other associated variables; these configurations are stored in the directory “/etc/sysconfig/network-scripts”.
The syntax to show the content of a specific interface configuration script is mentioned below:
$ cat /etc/sysconfig/network-scripts/ifcfg-<interface-name>
Configuration Data Stored in Interface Configuration File
Individual network device software interfaces are controlled by an interface configuration file. These files are used by the system to determine which interfaces to drag up and how to configure them when it boots up. An interface configuration script is available for each network interface. These files each contain information related to a single network interface. To list the interfaces of “/etc/network/”, run the below-mentioned command:
$ ls /etc/network/
if: if are applications that handle network interfaces
ifup: it enables network cards
ifdown: it disables network cards
Configuration Data Stored in Dhclient Configuration File
The dhclient config file is useful because it allows you to extend and configure DHCP on Linux. DHCP, abbreviated as Dynamic Host Configuration Protocol, is the most useful tool available to administrators. Most of the days would be spent by IT administrators to manually assign ip-addresses to networked devices if DHCP didn’t exist.
The “/etc/dhcp/dhcpd.conf” is the file that contains DHCP configuration data. The network configuration information requested by DHCP clients is stored in this file. Run the below-mentioned command to check for a dhclient configuration file.
$ cat /etc/dhcp/dhclient.conf
Configuration Data Stored in Host Configuration File
This file’s ground cause is to resolve host-names that would not be resolved by any other method. On small networks without a DNS server, it can also be used to resolve hostnames. This file should have a line giving the ip-address of the loopback device, regardless of the sort of network the machine is on.
The “/etc/hosts” file contains host configuration files. Run the below-mentioned command to check for the host configuration file.
$ cat /etc/hosts
Configuration Data Stored in Sysctl Configuration File
The Sysctl conf file, “etc/sysctl.conf” is a set of system and configuration files that tell the Linux OS what to do when it boots up. According to the sysctl configuration file, the Linux OS or the system manager adds or changes settings to the Linux kernel during startup.
There are two different options to change existing kernels. The first option is to recompile or upgrade the kernel from your distribution or you can also adjust specific parameters for it using the sysctl.conf file.
Run the below-mentioned command to check for a sysctl configuration file.
$ cat etc/sysctl.conf
Some computer programs employ files to configure their attributes and initial settings. These files are called configuration files. Configuration files are used to store configuration data of different types. There are multiple configuration files on the Linux system. In this article, we discussed some configuration files where our configuration data is stored, like network scripts, interface, dhclient, host, sysctl configuration files.
Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.