Sign inSign up

robomagus/go-mdns-bridge

By robomagus

•Updated over 1 year ago

LightWeight mDNS proxy in GoLang

Image
0

1.9K

robomagus/go-mdns-bridge repository overview

⁠go-mdns-bridge

Docker Image Build Status

LightWeight mDNS bridge written in GoLang.

⁠Features

In its current status it is a work-in-progress(!) side project with the following functionalities:

  • DNS server that queries mDNS services.
  • Proxy that routes requests to the mDNS end device.

⁠Dependencies

A linux host running the Avahi Daemon. Mounts to /var/run/dbus and var/run/avahi-daemon are required for this container to operate correctly.

⁠Usage

The main usecase for this image (or at least mine) is to query mDNS devices using a custom domain query, e.g. <device-name>.local.example.com. This enables devices that do not play nice with mDNS to contact these devices by name.

This can be done by adding this service as an upstream DNS server⁠ to e.g. AdGuardHome⁠.

As a secondary usecase this service can proxy web traffic to these mDNS devices by path-prefix. E.g. by pointing a reverse-proxy to this container on address local.example.com, a device with hostname device1 could be accessed through the URL local.example.com/device1.

⁠Example docker-compose
services:
  go-mdns-bridge:
    image: robomagus/go-mdns-bridge
    hostname: go-mdns-bridge
    volumes:
      - /var/run/dbus:/var/run/dbus 
      - /var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket
    labels:
      - "traefik.enable=true"
      - "traefik.port=5000"
      - "traefik.http.routers.mdns-bridge.rule=Host(`local.${DOMAIN}`)" # Path handled by Proxy
      - "traefik.http.routers.mdns-bridge.entrypoints=https"
      - "traefik.http.services.mdns-bridge.loadbalancer.server.port=5000"
    ports:
      - 5555:5000
    environment:
      - DNS_REGEXP=(.*)\.home$$;(.*)\.local\.${DOMAIN}$$
      - QUERY_DOMAIN=.local

⁠Github

Additional information can be found on this projects Github page⁠.

Tag summary

Content type

Image

Digest

sha256:9335ef1cf…

Size

5.2 MB

Last updated

about 4 years ago

docker pull robomagus/go-mdns-bridge