Getting information on DNS servers with DNSPython
In this section, we will create a DNS client in Python and see how this client obtains information about name servers, mail servers, and IPV4/IPV6 addresses.
DNS protocol
DNS stands for Domain Name Server, the domain name service used to link IP addresses with domain names. DNS is a globally-distributed database of mappings between hostnames and IP addresses. It is an open and hierarchical system with many organizations choosing to run their own DNS servers. These servers allow other machines to resolve the requests that originate from the internal network itself to resolve domain names.
The DNS protocol is used for different purposes. The most common are the following:
- Names resolution: Given the complete name of a host, it can obtain its IP address.
- Reverse address resolution: It is the reverse mechanism to the previous one. It can, given an IP address, obtain the name associated with it.
- Mail servers resolution...