Giter Site home page Giter Site logo

mdns's Introduction

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.

mdns's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.