In this example, we are checking the properties of a specific domain and checking whether a domain is a suddomain or superdomain from another.
You can find the following code in the dns_domains.py file:
import dns.name
domain1= dns.name.from_text('www.dnspython.org')
domain2 = dns.name.from_text('dnspython.org')
print(domain2 .is_subdomain(domain1))
print(domain2 .is_superdomain(domain1))