How To Install nss-mdns on CentOS 7

In this tutorial we learn how to install nss-mdns on CentOS 7. nss-mdns is glibc plugin for .local name resolution

Introduction

In this tutorial we learn how to install nss-mdns on CentOS 7.

What is nss-mdns

nss-mdns is a plugin for the GNU Name Service Switch (NSS) functionality of the GNU C Library (glibc) providing host name resolution via Multicast DNS (aka Zeroconf, aka Apple Rendezvous, aka Apple Bonjour), effectively allowing name resolution by common Unix/Linux programs in the ad-hoc mDNS domain .local. nss-mdns provides client functionality only, which means that you have to run a mDNS responder daemon separately from nss-mdns if you want to register the local host name via mDNS (e.g. Avahi).

We can use yum or dnf to install nss-mdns on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install nss-mdns.

Install nss-mdns on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install nss-mdns using yum by running the following command:

sudo yum -y install nss-mdns

Install nss-mdns on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install nss-mdns using dnf by running the following command:

sudo dnf -y install nss-mdns

How To Uninstall nss-mdns on CentOS 7

To uninstall only the nss-mdns package we can use the following command:

sudo dnf remove nss-mdns

References

Summary

In this tutorial we learn how to install nss-mdns on CentOS 7 using yum and dnf.