Troubleshooting the `Failed to start Berkeley Internet Name Domain (DNS)` error message

If the Named service goes down we check its status with systemctl status named or journalctl -xe, however sometimes both commands do not contain any indication of specific zone causing the error:

Replacing a degraded drive in a software RAID 1 array

After physically replacing the degraded drive with the new one and rebooting the system, run the folowing command to create exactly the same partitioning on /dev/sdb (new drive) as on /dev/sda (healthy existing drive):

sfdisk -d /dev/sda | sfdisk /dev/sdb

You can run

fdisk -l

to check if both hard drives have the same partitioning now.

Next we add /dev/sdb1 to /dev/md126 and /dev/sdb2 to /dev/md127:

mdadm --manage /dev/md126 --add /dev/sdb1
mdadm --manage /dev/md127 --add /dev/sdb2


How to investigate sessions

To list all current sessions:

loginctl list-sessions

To investigate details of particular session run:

loginctl show-session [session_id]

The sessions files are located in /run/systemd/sessions on Fedora-based systems and in /run/systemd/sessions on Debian-based systems.

If sessions fill up the /run directory for 100% then per recommendation on

Recursively copying between two directories including hidden files

Sometimes we need to override large structure of directories and subdirectories with newer files.

There are two ways of copying all the files in one directory including subdirectories and hidden files to another directory:

cd /orig/dir
tar cvf - . | (cd /dest/dir; tar xvf -)

which tars up the current directory to stdout then pipes it to a subshell that first cd's to the destination directory before untarring stdin.

The second way of doing this is using cp:

yes | cp -rT /orig/dir /dest/dir 2> /dev/null

Instaling pip command on CentOS

Enable the epel repository and run:

yum install python-pip to get:

yum install python-pip
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base:
* epel:
* extras:
* updates:
Resolving Dependencies
--> Running transaction check
---> Package python-pip.noarch 0:7.1.0-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved


Creating a patch file with diff command

To create a patch file simply run:

diff -u functions.php.orig functions.php > a.patch


Rename network interface back to old "eth0" on Fedora/RHEL/CentOS

The easiest way to restore the old way Kernel/modules/udev rename your ethernet interfaces is supplying these kernel parameters to Fedora 19:


To do so follow this steps:

  1. Edit /etc/default/grub
  2. At the end of GRUB_CMDLINE_LINUX line append "net.ifnames=0 biosdevname=0"
  3. Save the file
  4. Type "grub2-mkconfig -o /boot/grub2/grub.cfg"
  5. Type "reboot"

Removing the RAID metadata

If you see the “Disk contains BIOS metadata, but is not part of any recognized BIOS RAID sets. Ignoring disk sda” error message during OS installation, then you need to remove the raid metadata the “classic” way:

dmraid -r -E /dev/sda
Do you really want to erase "pdc" ondisk metadata on /dev/sda ? [y/n] :

Postfix: Sender address rejected: Domain not found (in reply to RCPT TO command))

If you are trying to send emails from a local application on a CentOS machine that is not a primary mail server, then you might hit the

Sender address rejected: Domain not found (in reply to RCPT TO command))
error. In this case you need to rewrite the outgoing address that is being rejected to something that make sense with the proper domain for the users.

Here are the quick steps to accomplish this:

nano /etc/postfix/

Modify the "mydomain" variable to your email domain


Subscribe to Front page feed