How To Install libnet-nslookup-perl on Ubuntu 20.04

In this tutorial we learn how to install libnet-nslookup-perl on Ubuntu 20.04. libnet-nslookup-perl is simple DNS lookup module for perl

Introduction

In this tutorial we learn how to install libnet-nslookup-perl on Ubuntu 20.04.

What is libnet-nslookup-perl

libnet-nslookup-perl is:

Net::Nslookup provides the capabilities of the standard UNIX command line tool nslookup(1). Net::DNS is a wonderful and full featured module, but quite often, all you need is nslookup $host. Net::Nslookup provides that functionality.

Net::Nslookup exports a single function, called nslookup. nslookup can be used to retrieve A, PTR, CNAME, MX, and NS records.

my $a = nslookup(host => “use.perl.org”, type => “A”);

my @mx = nslookup(domain => “perl.org”, type => “MX”);

my @ns = nslookup(domain => “perl.org”, type => “NS”);

There are three methods to install libnet-nslookup-perl on Ubuntu 20.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install libnet-nslookup-perl Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install libnet-nslookup-perl using apt-get by running the following command:

sudo apt-get -y install libnet-nslookup-perl

Install libnet-nslookup-perl Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install libnet-nslookup-perl using apt by running the following command:

sudo apt -y install libnet-nslookup-perl

Install libnet-nslookup-perl Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install libnet-nslookup-perl using aptitude by running the following command:

sudo aptitude -y install libnet-nslookup-perl

How To Uninstall libnet-nslookup-perl on Ubuntu 20.04

To uninstall only the libnet-nslookup-perl package we can use the following command:

sudo apt-get remove libnet-nslookup-perl

Uninstall libnet-nslookup-perl And Its Dependencies

To uninstall libnet-nslookup-perl and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove libnet-nslookup-perl

Remove libnet-nslookup-perl Configurations and Data

To remove libnet-nslookup-perl configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge libnet-nslookup-perl

Remove libnet-nslookup-perl configuration, data, and all of its dependencies

We can use the following command to remove libnet-nslookup-perl configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge libnet-nslookup-perl

References

Summary

In this tutorial we learn how to install libnet-nslookup-perl package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.