There are 2 methods for installing and removing packages on Red Hat based distros such as CentOS, Fedora, or RHEL. Often times newcomers are confused by what looks to be duplicate commands but these 2 commands are complimentary and should be used as follows.
When installing & removing packages you should 95% of the time use
yum to do the heavy lifting. So to install a package:
$ yum install <package>
To remove a package:
$ yum remove <package>
So then the question becomes, what package does a given file belong to? To determine this you can use the command
type to programmatically figure this out.
$ type -p dig
To determine what RPM package a given file belongs to you can use
rpm to query the system's RPM database like so for this:
$ rpm -qf /usr/bin/dig
So you can get fancy and do the
type command along with the
rpm command in a one liner like this:
$ rpm -qf $(type -p dig)
So why can't I just use RPM to install and remove?
It's true that you can make use of
rpm's erase switch,
-e to remove a package but I often encourage new comers to use
yum has a more high level perspective of the system and can determine if the removal of a given package will impact other packages, and
yum can also remove other unnecessary packages when you direct it to remove a given package if they're no longer required.
NOTE So the bottom line is
yum is just smarter about package management then
Is removing these a "good thing"?
Since this packages was optionally installed after your system was setup/installed its removal is not a big deal. However I'd caution you about removing packages that you don't fully understand their role, especially packages such as this one where there are several tools included, and not just one.
Often times there are a suite of command line tools that are included in a package that will typically go unused, meanwhile some other tool in the suite is used either by you constantly or by other tools/scripts/cronjobs constantly.
The removal of such tools can lead to annoying breakages for you and generally just wastes your time, so I'd encourage you to just leave these packages installed.