A fast python implementation of breaking down DNS domains into parts.
Project description
Overview
Parses DNS domain names into three parts: the prefix, the registered domain and it's registration point.
Usage
From the CLI
dnssplit www.google.co.uk www.yahoo.com
www.google.co.uk:
Prefix: www
Domain: google.co.uk
Reg Point: co.uk
www.yahoo.com:
Prefix: www
Domain: yahoo.com
Reg Point: com
Using the API
import dnssplitter
splitter = dnssplitter.DNSSplitter()
splitter.init_tree() # uses internal data
# or load your own:
# splitter.load_psl_file("/path/to/public_suffix_list.dat")
results = splitter.search_tree("www.foo.co.uk")
# Returns an array of [prefix, registered_domain, public_point]:
# results == ['www', 'foo.co.uk', 'co.uk']
Reason for being
There are a number of PSL breakdown libraries. But this one is faster than the others based on some initial tests, and returns more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dnssplitter-1.0.0.tar.gz
(44.0 kB
view hashes)
Built Distribution
Close
Hashes for dnssplitter-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7271003f36a003be566d21d7fc0ee8e9ee1f0de50ba86ab386f415b13926eec1 |
|
MD5 | bffc183625c2c8507a4e9cb2c8c53131 |
|
BLAKE2b-256 | de29489c736843c55727fa5ad4ad2f847b7776907dded08740691e3328406a06 |