How To Install python-dnspython on Ubuntu 18.04

In this tutorial we learn how to install python-dnspython on Ubuntu 18.04. python-dnspython is DNS toolkit for Python

Introduction

In this tutorial we learn how to install python-dnspython on Ubuntu 18.04.

What is python-dnspython

python-dnspython is:

dnspython is a DNS toolkit for Python. It supports almost all record types. It can be used for queries, zone transfers, and dynamic updates. It supports TSIG authenticated messages and EDNS0.

dnspython provides both high and low level access to DNS. The high level classes perform queries for data of a given name, type, and class, and return an answer set. The low level classes allow direct manipulation of DNS zones, messages, names, and records.

There are three methods to install python-dnspython on Ubuntu 18.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 python-dnspython Using apt-get

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

sudo apt-get update

After updating apt database, We can install python-dnspython using apt-get by running the following command:

sudo apt-get -y install python-dnspython

Install python-dnspython Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install python-dnspython using apt by running the following command:

sudo apt -y install python-dnspython

Install python-dnspython 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 python-dnspython using aptitude by running the following command:

sudo aptitude -y install python-dnspython

How To Uninstall python-dnspython on Ubuntu 18.04

To uninstall only the python-dnspython package we can use the following command:

sudo apt-get remove python-dnspython

Uninstall python-dnspython And Its Dependencies

To uninstall python-dnspython and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove python-dnspython

Remove python-dnspython Configurations and Data

To remove python-dnspython configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge python-dnspython

Remove python-dnspython configuration, data, and all of its dependencies

We can use the following command to remove python-dnspython configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge python-dnspython

References

Summary

In this tutorial we learn how to install python-dnspython package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.