Domain Ownership Checker
Project description
This Python library implements different strategies to validate the ownership of a domain name.
Available strategies
All strategies takes 3 arguments: the domain to check, a static DNS safe prefix like “yourservice-domain-verification” and a randomly generated code.
DNS TXT record: checks for the {prefix}-{code} string present in one of the TXT records on the domain name.
DNS CNAME record: checks for the existence of CNAME` record composed on the static ``{prefix}-{code} on the domain pointing to domain (usually yours) which the host is {prefix} (i.e.: {prefix}.yourdomain.com). NOTE: you may want to make sure that {prefix}.yourdomain.com resolves to something as some zone editors may check that.
Meta Tag: checks for the presence of a <meta name="{prefix}" content="{code}"> tag in the <head> part of the domain’s home page using either HTTP or HTTPs protocols.
HTML File: checks for the presence of a file named {code}.html at the root of the domain’s website containing the string {prefix}={code} using either HTTP or HTTPs protocols.
Usage Example
Simple usage will check the domain with all available strategies and return True if the validation passed:
import domcheck
domain = "example.com"
prefix = "myservice-domain-verification"
code = "myserviceK2d8a0xdhh"
if domcheck.check(domain, prefix, code):
print "This domain is verified"
You may filter strategies by passing a coma separated list of strategies:
domcheck.check(domain, prefix, code, strategies="dns_txt,meta_tag")
Installation
To install domcheck, simply:
$ pip install domcheck
Licenses
All source code is licensed under the MIT License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file domcheck-1.1.4.tar.gz
.
File metadata
- Download URL: domcheck-1.1.4.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c741b9e409d5165bcbd2eb5ec3cf8b2a0a44570a07c666b1ef8322cce3a1f13 |
|
MD5 | 0716a5309893796e044277cc125dd773 |
|
BLAKE2b-256 | 7b4a4ad714bf82d3edbee9f04a418461b76383da06cb33bbb118ab5c9fc62b4e |
File details
Details for the file domcheck-1.1.4-py2.py3-none-any.whl
.
File metadata
- Download URL: domcheck-1.1.4-py2.py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75f8c6d5b99c608a32301d971f4410fcdee67a5b65fb771f88783a787f5c4b66 |
|
MD5 | ad1276d988859c76f90d0c1348aaf89f |
|
BLAKE2b-256 | e39e73fe6546b2b66909ef67e67ec0722497fe30b1d74fc842e04d90bbf744b0 |