Manipulating domain names

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))
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset