Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

SRV record resolver for python

Project description

SRV resolver

PyPI version PyPI license PyPI format

Helper to get record from SRV address according to RFC2782.


  • support of record weights and priorities
  • check service availability at specific port
  • random record selector
  • cache with ttl support


The package can be installed simply by using pip:

pip install srvresolver


from srvresolver.srv_resolver import SRVResolver

# get all records

# get one random record with working connection 

# get first available server


Resolver with DNS cache

This one uses cache implemented in dnspython module.

from srvresolver.srv_resolver_cached import SRVResolverCached

# get all records
# same but don't do dns request, load from cache if not expired

Postgres SRV record resolver

Extract postgres records from SRV and check whether master or slave. Requires psycopg2

from srvresolver.postgres_resolver import PostgresResolver

# get random working slave record
PostgresResolver.get_slave('', username, password)

# get random working master record
PostgresResolver.get_master('', username, password)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for srvresolver, version 0.3.5
Filename, size File type Python version Upload date Hashes
Filename, size srvresolver-0.3.5-py3-none-any.whl (7.9 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size srvresolver-0.3.5.tar.gz (5.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page