Giter Site home page Giter Site logo

baywolf-studios / mdns-publisher Goto Github PK

View Code? Open in Web Editor NEW

This project forked from carlosefr/mdns-publisher

0.0 1.0 0.0 54 KB

Publish CNAMEs pointing to the local host over Avahi/mDNS

License: MIT License

Python 95.89% Makefile 1.34% Dockerfile 2.77%

mdns-publisher's Introduction

mDNS CNAME Publisher

ABOUT

This service/library publishes CNAME records pointing to the local host over multicast DNS using the Avahi daemon found in all major Linux distributions. Useful as a poor-man's service discovery or as a helper for named virtual-hosts in development environments.

Since Avahi is compatible with Apple's Bonjour, these names are usable from MacOS X and Windows too.

See also:

DOCKER

compose.yaml

services:
  mdns-publisher:
    image: baywolfstudios/mdns-publisher
    security_opt:
      - apparmor:unconfined
    volumes:
      - /run/dbus/system_bus_socket:/run/dbus/system_bus_socket
    environment:
      CNAMEs: testhome.local test.home.local

DEPENDENCIES

Besides a running Avahi daemon, this service requires the dbus-python bindings which, in turn, requires the development packages for D-Bus and D-Bus Glib (eg. dbus-devel and dbus-glib-devel in CentOS 7).

INSTALLATION

This package can be installed from source by running:

python setup.py build
python setup.py install

Or, you can install the latest stable release from PyPI:

pip install mdns-publisher

Note: If you're using Python 2.7 and you get errors installing dbus-python, you may need to upgrade your pip version:

pip install --upgrade pip

RUNNING

Pass (one or more) CNAMEs as command-line arguments to mdns-publish-cname:

mdns-publish-cname name01.local name02.local

Names must use the .local domain but can have arbitrary sub-domains:

mdns-publish-cname name01.local name02.local name03.mysubdomain.local

If the server running mdns-publish-cname is being announced over mDNS as myserver.local, all of these names will be answered by Avahi as CNAMEs for myserver.local, regardless of any sub-domains they might have. They remain available as long as mdns-publish-cname is running.

Run mdns-publish-cname with no arguments to find out about the available options.

Note: You can find a sample mdns-publish-cname.service file for systemd in the source repository.

INTEGRATING

The AvahiPublisher class in the mpublisher module can be integrated into your application to have it publish its own CNAMEs.

mdns-publisher's People

Contributors

carlosefr avatar matthewpritchett avatar dependabot[bot] avatar

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.