/usr/share/doc/python3-dns/examples
NameSizeModeActions
ddns.py12040644editdlrm
e164.py1520644editdlrm
mx.py2250644editdlrm
name.py4680644editdlrm
reverse.py13530644editdlrm
reverse_name.py1770644editdlrm
xfr.py3930644editdlrm
zonediff.py111220644editdlrm
Edit: /usr/share/doc/python3-dns/examples/name.py (468B)
#!/usr/bin/env python from __future__ import print_function import dns.name n = dns.name.from_text('www.dnspython.org') o = dns.name.from_text('dnspython.org') print(n.is_subdomain(o)) # True print(n.is_superdomain(o)) # False print(n > o) # True rel = n.relativize(o) # rel is the relative name www n2 = rel + o print(n2 == n) # True print(n.labels) # ['www', 'dnspython', 'org', '']