{ "info": { "author": "Filip \u0160", "author_email": "projects@filips.si", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Topic :: Internet :: Name Service (DNS)", "Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator", "Topic :: Security :: Cryptography", "Topic :: Software Development :: Libraries", "Topic :: Utilities" ], "description": "DNSLink for Python\n==================\n\n[![version][icon-version]][link-pypi]\n[![downloads][icon-downloads]][link-pypi]\n[![license][icon-license]][link-license]\n[![python][icon-python]][link-python]\n\n[![linux build][icon-travis]][link-travis]\n[![windows build][icon-appveyor]][link-appveyor]\n[![coverage][icon-coverage]][link-coverage]\n[![quality][icon-quality]][link-quality]\n\nPython implementation of DNSLink protocol.\n\n## Description\n\nDNSLink is a very simple protocol to link content and services directly from DNS. DNSLink leverages the powerful distributed architecture of DNS for a variety of systems that require internet-scale mutable names or pointers. For more details see [DNSLink website][link-dnslink].\n\nThis package provides a simple way to get and resolve DNSLink TXT records for any domain name.\n\n## Installation\n\n### Requirements\n\nDNSLink requires Python 3.4 or higher.\n\n### From PyPI\n\nThe recommended way to install DNSLink is from PyPI with PIP.\n\n```bash\npip install dnslink\n```\n\n### From Source\n\nAlternatively, you can also install it from the source.\n\n```bash\ngit clone https://github.com/filips123/DNSLinkPy.git\ncd DNSLinkPy\npython setup.py install\n```\n\n## Usage\n\nYou can use a `resolve` function to resolve DNSLink records for a specific domain. It first tries to resolve the domain's `_dnslink` subdomain and then fall back to the main domain if no records were found.\n\n**Note:** To illustrate examples, we will assume that domains are using this example DNSLink configuration.\n\n```bash\n$ dig +short TXT example.com\ndnslink=/ipfs/QmaYRVyPKpN8FXy9HS1t9Zhtjo4RpYXgiuNj1ins9fiLuW\ndnslink=/ipns/website.ipfs.io\n\n$ dig +short TXT foo.com\ndnslink=/dnslink/bar.com\n\n$ dig +short TXT bar.com\ndnslink=/ipfs/QmaYRVyPKpN8FXy9HS1t9Zhtjo4RpYXgiuNj1ins9fiLuW\n```\n\nThe function takes a domain name as a first (`domain`) argument and returns a list of all DNSLink records for that domain.\n\n\n```py\nimport dnslink\n\ndomain = 'example.com'\nrecords = dnslink.resolve(domain=domain)\n\nfor record in records:\n print(record)\n\n# /ipfs/QmaYRVyPKpN8FXy9HS1t9Zhtjo4RpYXgiuNj1ins9fiLuW\n# /ipns/website.ipfs.io\n```\n\nIt is also possible to get only DNSLink records containing a specific protocol type. You can specify it as a second (`protocol`) argument.\n\n```py\nimport dnslink\n\ndomain = 'example.com'\nprotocol = 'ipns'\nrecords = dnslink.resolve(domain=domain, protocol=protocol)\n\nfor record in records:\n print(record)\n\n# /ipns/website.ipfs.io\n```\n\nAs RFC 1034 specifies, DNSLinks also supports chaining. If the record's protocol type is `dnslink`, it will try to resolve records of the domain that it is specified in it. The default recursion limit is 16. It is possible to change it with a third (`depth`) argument. When a recursion limit is reached, a record will be returned as is, without any future resolving.\n\n```py\nimport dnslink\n\nprint(dnslink.resolve(domain='foo.com')[0]) # /ipfs/QmaYRVyPKpN8FXy9HS1t9Zhtjo4RpYXgiuNj1ins9fiLuW\nprint(dnslink.resolve(domain='foo.com', depth=1)[0]) # /dnslink/bar.com\n```\n\nYou can specify a custom DNSPython resolver object as a fourth (`resolver`) argument. This can be used to provide a custom resolver configuration.\n\n```py\nimport dns.resolver\nimport dnslink\n\ndomain = 'example.com'\nresolver = dns.resolver.Resolver()\nrecords = dnslink.resolve(domain=domain, resolver=resolver)\n\nfor record in records:\n print(record)\n\n# /ipfs/QmaYRVyPKpN8FXy9HS1t9Zhtjo4RpYXgiuNj1ins9fiLuW\n# /ipns/website.ipfs.io\n```\n\n## Versioning\n\nThis library uses [SemVer][link-semver] for versioning. For the versions available, see [the tags][link-tags] on this repository.\n\n## License\n\nThis library is licensed under the MIT license. See the [LICENSE][link-license-file] file for details.\n\n[icon-version]: https://img.shields.io/pypi/v/dnslink.svg?style=flat-square&label=version\n[icon-downloads]: https://img.shields.io/pypi/dm/dnslink.svg?style=flat-square&label=downloads\n[icon-license]: https://img.shields.io/pypi/l/dnslink.svg?style=flat-square&label=license\n[icon-python]: https://img.shields.io/pypi/pyversions/dnslink.svg?style=flat-square&label=python\n\n[icon-travis]: https://img.shields.io/travis/com/filips123/DNSLinkPy.svg?style=flat-square&label=linux+build\n[icon-appveyor]: https://img.shields.io/appveyor/ci/filips123/DNSLinkPy.svg?style=flat-square&label=windows+build\n[icon-coverage]: https://img.shields.io/scrutinizer/coverage/g/filips123/DNSLinkPy.svg?style=flat-square&label=coverage\n[icon-quality]: https://img.shields.io/scrutinizer/g/filips123/DNSLinkPy.svg?style=flat-square&label=quality\n\n[link-pypi]: https://pypi.org/project/dnslink/\n[link-license]: https://choosealicense.com/licenses/mit/\n[link-python]: https://python.org/\n[link-travis]: https://travis-ci.com/filips123/DNSLinkPy/\n[link-appveyor]: https://ci.appveyor.com/project/filips123/DNSLinkPy/\n[link-coverage]: https://scrutinizer-ci.com/g/filips123/DNSLinkPy/code-structure/\n[link-quality]: https://scrutinizer-ci.com/g/filips123/DNSLinkPy/\n[link-semver]: https://semver.org/\n\n[link-dnslink]: https://dnslink.io/\n\n[link-tags]: https://github.com/filips123/DNSLinkPy/tags/\n[link-license-file]: https://github.com/filips123/DNSLinkPy/blob/master/LICENSE\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/filips123/DNSLinkPy/", "keywords": "dns,dnslink,content-addressing,web3,decentralized", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "dnslink", "package_url": "https://pypi.org/project/dnslink/", "platform": "", "project_url": "https://pypi.org/project/dnslink/", "project_urls": { "Homepage": "https://github.com/filips123/DNSLinkPy/" }, "release_url": "https://pypi.org/project/dnslink/1.0.2/", "requires_dist": [ "dnspython (<3.0.0,>=1.0.0)", "pylint ; extra == 'lint'", "pytest ; extra == 'test'", "pytest-cov ; extra == 'test'" ], "requires_python": ">= 3.4", "summary": "Python implementation of DNSLink protocol", "version": "1.0.2" }, "last_serial": 5913948, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "e6f12461460ec49587de7cdf90a9f813", "sha256": "3e7da4446319b0c916b602e1b70a8379576a45736d56e04058fa508db1dff172" }, "downloads": -1, "filename": "dnslink-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e6f12461460ec49587de7cdf90a9f813", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.5", "size": 7997, "upload_time": "2019-09-22T18:18:47", "url": "https://files.pythonhosted.org/packages/82/44/ad6a348954eeed68dcc0b10ef2f70220c89af5afe16d55dc65625bd089d4/dnslink-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "36c00c808588a89db56df79514621a1a", "sha256": "2c1d7e8458b253061e6b8a071a798a9e0cd8efa198b0f3e78d8a0adb3e5b54c1" }, "downloads": -1, "filename": "dnslink-1.0.0.tar.gz", "has_sig": false, "md5_digest": "36c00c808588a89db56df79514621a1a", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.5", "size": 7104, "upload_time": "2019-09-22T18:18:50", "url": "https://files.pythonhosted.org/packages/22/1a/491b19fc1879aa0cdfc6b6335bf7b73d3dda62df2a221ce83f8876fcbc0b/dnslink-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "0393b809dc38a978c64c8b2e1f46c606", "sha256": "e9b19274cf854ce61a72367995112b3819f0d55de1dec7df6b068dcb6e234cee" }, "downloads": -1, "filename": "dnslink-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0393b809dc38a978c64c8b2e1f46c606", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.5", "size": 7982, "upload_time": "2019-09-27T17:31:31", "url": "https://files.pythonhosted.org/packages/ce/64/a33cc19d0045c73912d953aa2515e05046e5b31bf2215ea7d9b5c2f65f77/dnslink-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bfd400899cdf83a4342e074d7b29e3c4", "sha256": "a3bd110c2d4474c252b39d45fddae35468c005b90f69da115d4c7ca6450833e6" }, "downloads": -1, "filename": "dnslink-1.0.1.tar.gz", "has_sig": false, "md5_digest": "bfd400899cdf83a4342e074d7b29e3c4", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.5", "size": 7150, "upload_time": "2019-09-27T17:31:33", "url": "https://files.pythonhosted.org/packages/2c/0b/41a2f0bac6b53a1950d77c0da0db1d18f0e96c531bb43430518d3cceb334/dnslink-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "74b25eaf9251352fcc2c596dbb673ff3", "sha256": "63420efd4700c3fb9fd059d924af0901e43d4ce725a842551f63c57490e57272" }, "downloads": -1, "filename": "dnslink-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "74b25eaf9251352fcc2c596dbb673ff3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.4", "size": 7987, "upload_time": "2019-10-01T17:43:23", "url": "https://files.pythonhosted.org/packages/8e/5c/f15751952a03541df1caf77176c97b637e9fecb0e28769914118a338def2/dnslink-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "23de50e57cea31b4ac5e6958782c413f", "sha256": "70fb7899636ce17b45342e560b351bc7518c573ff02d71ef6136aec1f1d801d3" }, "downloads": -1, "filename": "dnslink-1.0.2.tar.gz", "has_sig": false, "md5_digest": "23de50e57cea31b4ac5e6958782c413f", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.4", "size": 7152, "upload_time": "2019-10-01T17:43:25", "url": "https://files.pythonhosted.org/packages/02/93/9ff55e7a24ffdc80a7915bee4b5d17a7be2792251ed858714e7f9a1c88ac/dnslink-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "74b25eaf9251352fcc2c596dbb673ff3", "sha256": "63420efd4700c3fb9fd059d924af0901e43d4ce725a842551f63c57490e57272" }, "downloads": -1, "filename": "dnslink-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "74b25eaf9251352fcc2c596dbb673ff3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">= 3.4", "size": 7987, "upload_time": "2019-10-01T17:43:23", "url": "https://files.pythonhosted.org/packages/8e/5c/f15751952a03541df1caf77176c97b637e9fecb0e28769914118a338def2/dnslink-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "23de50e57cea31b4ac5e6958782c413f", "sha256": "70fb7899636ce17b45342e560b351bc7518c573ff02d71ef6136aec1f1d801d3" }, "downloads": -1, "filename": "dnslink-1.0.2.tar.gz", "has_sig": false, "md5_digest": "23de50e57cea31b4ac5e6958782c413f", "packagetype": "sdist", "python_version": "source", "requires_python": ">= 3.4", "size": 7152, "upload_time": "2019-10-01T17:43:25", "url": "https://files.pythonhosted.org/packages/02/93/9ff55e7a24ffdc80a7915bee4b5d17a7be2792251ed858714e7f9a1c88ac/dnslink-1.0.2.tar.gz" } ] }