Skip to main content

A simple pure python implementation of a multicast DNS responder

Project description

anubi.mdns

PyPI PyPI - Python Version GitHub Documentation Status

This module is a pure python implementation of a mDNS responder. It provides DNS functionalities into a small network that uses the mDNS protocol.

Python compatibility

The module is compatible with:

  • Python 3.7
  • Python 3.8

It may be compatible also with previous versions of python but it has never been tested. If you test it with a python version not listed above please notify me so I can update the documentation.

Versioning

The version number follow the following pattern: MAJOR.MINOR.PATCH.TAG.

  • MAJOR version increment on backword incompatible changes
  • MINOR version increment on addition of new features
  • PATCH version incement on bug fixing and minor changes
  • TAG indicates project state (currently alpha)

Status

The project is currently in its alpha state. It used only by me in a small home environement. Right now the mDNS responder listen only on IPv4 mDNS addrress and support only type A resource records.

How to use anubi.mdns

Here 's an example of starting a mDNS responder that resolve some host names.

import signal
import anubi.mdns as mdns

# Create the responder instance
responder = mdns.mDNS()

# Create a SIGINT handler
def sigint_handler(sig_num, stack):
    #just to be sure
    if sig_num == signal.SIGINT:
        #stop the responder on SIGINT signal
        responder.stop()
        print('mDSN responder stopped')

# Register the signal handler
signal.signal(signal.SIGINT, sigint_handler)
# Create records for DNS
responder.add_record(DnsRRecordA('test.local.', 120, '127.0.0.1'))
# Start the responder
responder.start()
# Instruct the user how to stop the application
print('mDSN responder started.\nPress CTRL + C to stop it.')
#  Wait untill the responder terminates
responder.join()

Changelog

0.1.0a

  • Complete support for AAAA DNS records.
  • Add support for additional records. Now the additional records section contains AAAA records (if any) for A query and A records (if any) for AAAA query.

0.0.4a

  • Add support for AAAA DNS records.

0.0.3a

  • Update python requirements for pypi.

0.0.2a

  • Update project description and supported python versions for pypi.

0.0.1a

  • First release.

License

MIT, see here for details.

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

anubi.mdns-0.1.0a0.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anubi.mdns-0.1.0a0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file anubi.mdns-0.1.0a0.tar.gz.

File metadata

  • Download URL: anubi.mdns-0.1.0a0.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.0

File hashes

Hashes for anubi.mdns-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 b6ec78abe80167e3fee327930aeae22c2a58d1cc10c99bec8e2bde5656f1096c
MD5 25edd5e31a68e3a69cd5412be31e76f2
BLAKE2b-256 639ec71b4a2903ce34cf1482761aeb0e64f069b054789aba58878104b02fe99d

See more details on using hashes here.

File details

Details for the file anubi.mdns-0.1.0a0-py3-none-any.whl.

File metadata

  • Download URL: anubi.mdns-0.1.0a0-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.0

File hashes

Hashes for anubi.mdns-0.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 cc0916d79b43ee49cde46881ceef72141b0c1823a6b87c837f6808df8bab8f8b
MD5 858e53d09ada4da89812f2d1481c0644
BLAKE2b-256 6cb4df6a71de104bf90bd9887cf658354052ecd46d82cfb8e899bf2d8a8cd731

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page