Q. I’m not able to run nslookup or host command under Debian or Ubuntu Linux. In fact, these commands are missing from my installation. How do I install nslookup and related dns client commands?

A. You need to install a package called dnsutils – which provide clients such as nslookup, host and other tools. The Berkeley Internet Name Domain (BIND) implements an Internet domain name server. his package delivers various client programs related to DNS that are derived from the BIND source tree.


Install dnsutils

Login as the root user and type the following commands:
# apt-get update
# apt-get install dnsutils


Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  bind9-host libbind9-0 libdns22 libisc11 libisccc0 libisccfg1 liblwres9
Suggested packages:
The following NEW packages will be installed:
  bind9-host dnsutils libbind9-0 libdns22 libisc11 libisccc0 libisccfg1 liblwres9
0 upgraded, 8 newly installed, 0 to remove and 28 not upgraded.
Need to get 1339kB of archives.
After unpacking 3183kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://security.debian.org etch/updates/main libisc11 1:9.3.4-2etch1 [169kB]
Get:2 http://security.debian.org etch/updates/main libdns22 1:9.3.4-2etch1 [474kB]                                                          
Get:3 http://security.debian.org etch/updates/main libisccc0 1:9.3.4-2etch1 [94.0kB]                                                        
Get:4 http://security.debian.org etch/updates/main libisccfg1 1:9.3.4-2etch1 [106kB]                                                        
Get:5 http://security.debian.org etch/updates/main libbind9-0 1:9.3.4-2etch1 [94.0kB]                                                       
Get:6 http://security.debian.org etch/updates/main liblwres9 1:9.3.4-2etch1 [110kB]                                                         
Get:7 http://security.debian.org etch/updates/main bind9-host 1:9.3.4-2etch1 [113kB]                                                        
Get:8 http://security.debian.org etch/updates/main dnsutils 1:9.3.4-2etch1 [180kB]                                                          
Fetched 1339kB in 58s (22.9kB/s)                                                                                                            
Selecting previously deselected package libisc11.
(Reading database ... 14445 files and directories currently installed.)
Unpacking libisc11 (from .../libisc11_1%3a9.3.4-2etch1_i386.deb) ...
Selecting previously deselected package libdns22.
Unpacking libdns22 (from .../libdns22_1%3a9.3.4-2etch1_i386.deb) ...
Selecting previously deselected package libisccc0.
Unpacking libisccc0 (from .../libisccc0_1%3a9.3.4-2etch1_i386.deb) ...
Selecting previously deselected package libisccfg1.
Unpacking libisccfg1 (from .../libisccfg1_1%3a9.3.4-2etch1_i386.deb) ...
Selecting previously deselected package libbind9-0.
Unpacking libbind9-0 (from .../libbind9-0_1%3a9.3.4-2etch1_i386.deb) ...
Selecting previously deselected package liblwres9.
Unpacking liblwres9 (from .../liblwres9_1%3a9.3.4-2etch1_i386.deb) ...
Selecting previously deselected package bind9-host.
Unpacking bind9-host (from .../bind9-host_1%3a9.3.4-2etch1_i386.deb) ...
Selecting previously deselected package dnsutils.
Unpacking dnsutils (from .../dnsutils_1%3a9.3.4-2etch1_i386.deb) ...
Setting up libisc11 (9.3.4-2etch1) ...

Setting up libdns22 (9.3.4-2etch1) ...

Setting up libisccc0 (9.3.4-2etch1) ...

Setting up libisccfg1 (9.3.4-2etch1) ...

Setting up libbind9-0 (9.3.4-2etch1) ...

Setting up liblwres9 (9.3.4-2etch1) ...

Setting up bind9-host (9.3.4-2etch1) ...
Setting up dnsutils (9.3.4-2etch1) ...

Now you should able to use dig, host and other tools:
$ nslookup google.com
$ host cyberciti.biz


cyberciti.biz has address
cyberciti.biz mail is handled by 10 sun.simplyguide.org.

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

7 comments… add one
  • Rojs Jan 18, 2008 @ 15:27

    nslookup has been deprecated for a long time now in favor of ‘dig’.

    Dig has more functionality and information that it returns. I believe it is installed from the same deb package.

  • dustin3000 Jan 18, 2008 @ 16:09

    I find it amazing that these aren’t installed by default.

  • 🛡️ Vivek Gite (Author and Admin) nixCraft Jan 18, 2008 @ 17:40

    @Rojs, yes, host and dig are recommended.

    @dustin3000, Debian has option for minimum os installation, which skips basic command such as dig, ftp and many more.

  • Nilesh Jan 24, 2008 @ 9:29

    on fedora 7 it is bind-utils (doesn’t require bind but its libs bind-libs)

  • vasu Jun 9, 2009 @ 10:20

    How can i find out DNS server and DHCP configured in my linux system?what are the commands we use for it?

  • Daniel Apr 30, 2010 @ 15:56

    I just wanted to say thanks. This is probably the 30th solution I’ve found to different questions I’ve had. This site is a great resource – thanks for documenting things so thoroughly!

  • rhel Aug 5, 2012 @ 12:41

    For Redhat/CentOS/Scientific Linux/Fedora use

    “yum install bind-utils”

Leave a Reply

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

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.