How to Install dig and host commands on OpenSUSE Linux

I am trying to get dns rerecord for domain using the dig example.com and host example.com . But keep getting these error codes on OpenSUSE Linux

-bash: dig: command not found
-bash: host: command not found 

How can I install dig and host commands on OpenSUSE Linux?

Step 1. Search for command name

The syntax is

zypper se --provides 'bin/dig'
zypper se --provides 'bin/host'
Loading repository data...
Reading installed packages...

S | Name       | Summary                         | Type
--+------------+---------------------------------+--------
  | bind-utils | Utilities to query and test DNS | package

Step 2. Verify package on OpenSUSE Linux

Execute

zypper info bind-utils

Step 3. Installing dig and host commands on OpenSUSE using zypper

Finally, run

sudo zypper in bind-utils
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following NEW package is going to be installed:
  bind-utils

1 new package to install.
Overall download size: 353.0 KiB. Already cached: 0 B. After the operation,
additional 1.0 MiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package bind-utils-9.16.6-22.10.1.x86_64
                                          (1/1), 353.0 KiB (  1.0 MiB unpacked)
Retrieving: bind-utils-9.16.6-22.10.1.x86_64.rpm ...........[done (27.4 KiB/s)]

Checking for file conflicts: ............................................[done]
(1/1) Installing: bind-utils-9.16.6-22.10.1.x86_64 ......................[done]

Step 4. Test commands

Now all you have to do is

dig A nixcraft.com
dig AAAA cyberciti.biz
host google.com
host opensuse.org

Do check our dig:

Host command guides for more info:

1 Like

Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki