• Terrible mDNS responder

    From Sergey Bugaev@21:1/5 to All on Fri Mar 3 14:30:01 2023
    Hi,

    this is a shameless self-promotion :) I have posted about the Terrible
    mDNS responder on Mastodon before, but not on this list, and I have
    been making minor changes to it recently, so I thought I might as well
    announce it here, perhaps it could be useful to someone.

    Debian GNU/Hurd comes with Avahi in the default install (I believe).
    Avahi has never worked for me (on the Hurd), and I doubt it has ever
    worked for anyone else either. I *have* looked into the why (as in
    spent hours debugging and patching it); I don't remember the
    specifics, but I do remember that I concluded it won't be easy to make
    it work. So, a dead end.

    But I still wanted mDNS to work, for some definition of "work".
    Namely, I wanted to be able to refer to my Hurd box by its symbolic
    name, such as sergey-hurd-box.local (RIP) and hurdle.local, and not by
    its DHCP-leased IP address, because that one is a chore to type and
    remember, and could change in theory -- and it *did* change in
    practice once I set up eth-multiplexer, which must have caused its MAC
    to change (or something).

    So I wrote the Terrible mDNS responder, named so because it's really
    terrible and does not claim to be any good, quite the opposite, in
    fact. So, caveat usor. But that being said, it works very well for me
    in practice, does exactly what it was supposed to do (i.e. I can type "hurdle.local" and it works) and never once in the multiple years of
    use has it caused me any issue, not even a minor one, so maybe it's
    not that terrible after all.

    To be very clear, this does *not* teach the system to do mDNS queries
    (.local hostname lookups), this only makes it respond to other host's
    queries. (Those other hosts may be running Avahi or sd-rd or Apple's mDNSResponder or LookupServer or ...)

    The sources are over on GitHub [0]. There are no dependencies other
    than a libc. It's built with Meson and licensed under AGPL v3+. It
    even comes with an awkward attempt at a sysv init script! What's not
    to like?

    [0]: https://github.com/bugaevc/terrible-mdns-responder

    Sergey

    P.S. Something like this should get you up & running:
    $ git clone git@github.com:bugaevc/terrible-mdns-responder.git
    $ cd terrible-mdns-responder
    $ meson setup build
    $ ninja -C build
    $ sudo ninja install -C build
    $ sudo update-rc.d terrible-mdns-responder defaults
    $ sudo update-rc.d avahi-daemon disable
    $ sudo service terrible-mdns-responder start

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Joshua Branson@21:1/5 to Sergey Bugaev on Sat Mar 4 18:50:01 2023
    Sergey Bugaev <bugaevc@gmail.com> writes:

    Hi,

    this is a shameless self-promotion :) I have posted about the Terrible
    mDNS responder on Mastodon before, but not on this list, and I have
    been making minor changes to it recently, so I thought I might as well announce it here, perhaps it could be useful to someone.

    Debian GNU/Hurd comes with Avahi in the default install (I believe).
    Avahi has never worked for me (on the Hurd), and I doubt it has ever
    worked for anyone else either. I *have* looked into the why (as in
    spent hours debugging and patching it); I don't remember the
    specifics, but I do remember that I concluded it won't be easy to make
    it work. So, a dead end.

    P.S. Something like this should get you up & running:
    $ git clone git@github.com:bugaevc/terrible-mdns-responder.git
    $ cd terrible-mdns-responder
    $ meson setup build
    $ ninja -C build
    $ sudo ninja install -C build
    $ sudo update-rc.d terrible-mdns-responder defaults
    $ sudo update-rc.d avahi-daemon disable
    $ sudo service terrible-mdns-responder start

    Hmmm... How do you run the Hurd? Do you run linux on bare metal and
    then Hurd on qemu? When you are typing "herd.local" what does that
    mean?

    I suppose that means on your linux machine you are typing "ssh
    hurd.local"?

    May I help you create your email into some kind of manual page/wiki article/blog post?

    Thanks,

    Joshua Branson
    https://gnucode.me

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sergey Bugaev@21:1/5 to All on Sat Mar 4 19:20:01 2023
    Hmmm... How do you run the Hurd? Do you run linux on bare metal and
    then Hurd on qemu?

    Yes. I run Hurd on a qemu/libvirt VM that itself runs on GNU/Linux.

    When you are typing "herd.local" what does that
    mean?

    I suppose that means on your linux machine you are typing "ssh
    hurd.local"?

    Yes, on any machine that's on the same network as your Hurd machine,
    you should be able to use "its-hostname.local" to refer to it (if the
    machine's OS supports mDNS lookup). That's just how mDNS works, it's
    not specific to the Hurd, my configuration (briefly described below),
    or the Terrible mDNS responder (which is just one among all the mDNS
    responder implementations, and a terrible one at that :D).

    You can use its-hostname.local with ssh, or anywhere else where you'd
    use a host, such as with ping or curl or git, etc. Specifically, on
    Unix this is anything that uses gethostbyname() or getaddrinfo(). You
    can try asking glibc about it: `getent hosts its-hostname.local`. If
    you're running sd-rd, try `resolvectl query its-hostname.local`, and
    for Avahi try `avahi-resolve-host-name its-hostname.local`.

    In my case the network is the virtual network that libvirt creates;
    all the (suitably configured) libvirt VMs and the host are connected
    to this network and can all see & talk to each other. If you're using
    libvirt too, see the file /usr/share/libvirt/networks/default.xml and
    the output of `virsh --connect qemu:///system net-info default`.

    One thing where mDNS will *not* work is if you use qemu with "user
    networking" and pass hostfwd=tcp::5555-:22 or somesuch to get SSH
    access. In this case, there is no real network created, at least as
    far as the host is concerned, so it won't be able to talk to your VM
    over mDNS.

    May I help you create your email into some kind of manual page/wiki article/blog post?

    Maybe?

    But first, seeing that you're interested -- have you managed to build
    / install / use the Terrible mDNS responder? Does it work for you?

    Sergey

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From jbranso@dismail.de@21:1/5 to Sergey Bugaev on Sun Mar 5 04:00:01 2023
    March 4, 2023 1:01 PM, "Sergey Bugaev" <bugaevc@gmail.com> wrote:

    May I help you create your email into some kind of manual page/wiki
    article/blog post?

    Maybe?

    But first, seeing that you're interested -- have you managed to build
    / install / use the Terrible mDNS responder? Does it work for you?

    Sergey

    I am probably one of the least experience Hurd enthusiasts. I currently have
    a basic Hurd box (no X) running on a T46 (I think) with just 2 GB of RAM.

    I will try to set up the Terrible mDNS responder. I will let you know.

    Joshua

    P.S. Please don't be too disappointed if I get busy and forget to actually
    try it out. :(

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)