How To Install python3-dnspython on Debian 11

In this tutorial we learn how to install python3-dnspython on Debian 11. python3-dnspython is DNS toolkit for Python 3

Introduction

In this tutorial we learn how to install python3-dnspython on Debian 11.

What is python3-dnspython

python3-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.

With recommended additional dependencies installed it also support DNS Over HTTPS (DOH), DNSSEC, and non-ascii (IDNA) DNS operations. It can support asynchronous if python3-sniffio and python3-trio are installed, but this is not the default.

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.

This is the Python 3 version.

There are three methods to install python3-dnspython on Debian 11. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install python3-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 python3-dnspython using apt-get by running the following command:

sudo apt-get -y install python3-dnspython

Install python3-dnspython Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install python3-dnspython

Install python3-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 Debian. Update apt database with aptitude using the following command.

sudo aptitude update

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

sudo aptitude -y install python3-dnspython

How To Uninstall python3-dnspython on Debian 11

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

sudo apt-get remove python3-dnspython

Uninstall python3-dnspython And Its Dependencies

To uninstall python3-dnspython and its dependencies that are no longer needed by Debian 11, we can use the command below:

sudo apt-get -y autoremove python3-dnspython

Remove python3-dnspython Configurations and Data

To remove python3-dnspython configuration and data from Debian 11 we can use the following command:

sudo apt-get -y purge python3-dnspython

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

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

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

Dependencies

python3-dnspython have the following dependencies:

References

Summary

In this tutorial we learn how to install python3-dnspython package on Debian 11 using different package management tools: apt, apt-get and aptitude.