RPM-based package management can resolve a command by the absolute path that a repository package provides. On RHEL and Fedora, this allows DNF to install /usr/bin/dig even when the package name is not known in advance.
Enabled repository metadata allows DNF to select bind-utils for that executable path. A registered RHEL host needs access to its operating-system repositories, while Fedora uses the enabled release and updates repositories.
An RPM file-owner query ties the installed executable back to the managed package without adding the bind DNS server package. A lookup sent to an explicitly selected resolver then tests dig independently of the system resolver configuration.
Related: How to install dig on Ubuntu or Debian
Related: How to query DNS records with dig
Related: How to query a specific DNS server with dig
Steps to install dig on RHEL or Fedora:
- Install the repository package that provides /usr/bin/dig.
$ sudo dnf install --assumeyes /usr/bin/dig
DNF resolves the executable path to bind-utils from the enabled repositories. This installs the query utilities without installing or enabling the named DNS server.
- Identify the installed RPM that owns /usr/bin/dig.
$ rpm --query --file /usr/bin/dig bind-utils-9.18.50-1.fc44.aarch64
The version, release, and architecture suffix follow the selected RHEL or Fedora repository.
- Send an A record query directly to the Cloudflare resolver.
$ dig @1.1.1.1 example.com A +short 172.66.147.243 104.20.23.154
One or more IPv4 addresses confirm that the installed client reached the selected resolver and received answer records. Networks that block public DNS need an approved reachable resolver in place of 1.1.1.1, and the addresses or their order can change.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.