Skip to content

What is the /etc/aliases file

Category
Linux
On this page

What is /etc/aliases?

/etc/aliases is a text file used to store email aliases on a Linux system. Email aliases are basically nicknames for email addresses. They allow you to send emails to a group of people using a single address, or to redirect emails from one address to another.

/etc/aliases are typically used to store aliases for the system’s mail server. However, it can also be used to store aliases for any other purpose.

For example, you could use /etc/aliases to create an alias for your own email address. This file is stored in the /etc directory, which is the standard location for system-wide configuration files. /etc/aliases are usually managed by the system administrator. However, you can also edit /etc/aliases yourself if you need to add or change an alias.

Adding entry to /etc/aliases

To add a new alias to /etc/aliases, simply open the file in a text editor and add a new line with the following format:

alias_name: real_name@domain.com

Replace the alias_name with the desired alias, and real_name@domain.com with the actual email address you wish to forward messages to. You can also forward one user’s email to another user.

Once you have saved your changes, run the newaliases command to update the aliases database.

newaliases

Your new alias will now be active and forward messages as expected.

Hope this tutorial helps you to understand the uses of /etc/aliases file.

Rahul

Rahul Kumar is the founder and chief editor of TecAdmin.net. A Red Hat Certified Engineer (RHCE), he has worked in IT since 2009, with hands-on experience in Linux system administration, DevOps, web hosting, cloud platforms and automation. He started TecAdmin in 2013 to share practical, step-by-step guides, and leads its editorial work with one aim: making technical learning clear and useful for sysadmins, developers and beginners alike.

Leave a Reply

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


Back to top