Giter Club home page Giter Club logo

mdns-discovery-proxy's Introduction

This is a Discovery Proxy for Multicast DNS-Based Service Discovery, written in pure Python. It makes use of zeroconf to obtain mDNS advertisements on the local network and Twisted to re-publish them as a unicast DNS service.

This kind of proxy is specified by RFC 8766. I did not actually follow the standard in implementing it, which means that it doesn't abide by many of the finer details. Nevertheless, it works fine with clients like macOS 10.15 and iOS 13. Any violations of the standard are to be considered bugs and should be fixed over time.

Other implementations of discovery proxies are ohybridproxy and included with mDNSResponder. Since the former only runs on OpenWRT and mDNSResponder is not readily available on Linux, I decided to put together my own implementation in Python. Its dependencies are pure Python, so it should be possible to run it pretty much anywhere.

To use the discovery proxy, run it while specifying a domain to use and a port number to listen on:

python3 proxy.py home.arpa 35353

Then, delegate that domain to the machine the proxy is running on (192.0.2.2 in the example below) and advertise it by adding the necessary records to your network's DNS search domain (example.com in the example below). If you are using dnsmasq, this can be done using

server=/home.arpa/192.0.2.2#35353
ptr-record=b._dns-sd._udp.example.com,home.arpa
ptr-record=lb._dns-sd._udp.example.com,home.arpa
ptr-record=db._dns-sd._udp.example.com,home.arpa

To check whether it is working, you can try some of the following queries (assuming your computer is named yourcomputer and advertises an SSH service):

dig yourcomputer.home.arpa
dig _ssh._tcp.home.arpa ptr
dig yourcomputer._ssh._tcp.home.arpa srv

mdns-discovery-proxy's People

Contributors

mkuron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mdns-discovery-proxy's Issues

Convert to twistd plugin

Hi, first off thanks for this code, I hope this is exactly what I need!

Secondly this isn't really an issue, but I am looking for the recommended way to run this in the same reactor with other twisted code.

I think i could setup the factory as per your main() method but it would be quite nice to have this as a twisted plugin as exists here:
https://docs.twisted.org/en/stable/core/howto/tap.html

I'm not really so familiar with this but I may give it a shot after integrating this code.

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.