https://github.com/gmr/srvlookup
A small wrapper for dnspython to return SRV records for a given host, protocol, and domain name as a list of namedtuples
https://github.com/gmr/srvlookup
dns python srv srv-record
Last synced: about 2 months ago
JSON representation
A small wrapper for dnspython to return SRV records for a given host, protocol, and domain name as a list of namedtuples
- Host: GitHub
- URL: https://github.com/gmr/srvlookup
- Owner: gmr
- License: other
- Created: 2014-03-11T17:09:26.000Z (about 11 years ago)
- Default Branch: main
- Last Pushed: 2022-04-26T16:52:25.000Z (about 3 years ago)
- Last Synced: 2025-04-09T22:18:15.115Z (about 2 months ago)
- Topics: dns, python, srv, srv-record
- Language: Python
- Homepage:
- Size: 37.1 KB
- Stars: 23
- Watchers: 17
- Forks: 13
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
srvlookup
=========
A small wrapper for dnspython to return SRV records for a given host, protocol,
and domain name as a list of namedtuples.|Version| |Status| |Coverage| |License|
Installation
------------
srvlookup is available on the `Python Package Index `_. Simply:.. code:: bash
pip install srvlookup
Example
-------
.. code:: python>>> import srvlookup
>>> srvlookup.lookup('api', 'memcached')
[SRV(host='192.169.1.100', port=11211, priority=1, weight=0, host='memcache1.local'),
SRV(host='192.168.1.102', port=11211, priority=1, weight=0, host='memcache2.local'),
SRV(host='192.168.1.120', port=11211, priority=1, weight=0, host='memcache3.local'),
SRV(host='192.168.1.126', port=11211, priority=1, weight=0, host='memcache4.local')]
>>>Testing
-------
.. code:: bashpython setup.py nosetests
Requirements
------------- `dnspython `_
.. |Version| image:: https://img.shields.io/pypi/v/srvlookup.svg?
:target: https://pypi.python.org/pypi/srvlookup.. |Status| image:: https://img.shields.io/travis/gmr/srvlookup.svg?
:target: https://travis-ci.org/gmr/srvlookup.. |Coverage| image:: https://img.shields.io/codecov/c/github/gmr/srvlookup.svg?
:target: https://codecov.io/github/gmr/srvlookup?branch=master.. |License| image:: https://img.shields.io/pypi/l/pika.svg?
:target: https://pika.readthedocs.io