Hello everyone, I have I guess a bit tricky situation on hand

I have 4 devices (2 computers, 2 cellphones) on my home network, they’re all connected on the same LAN, and additionally, all are also running Tailscale (rather out of the box configuration except specific IPv4 addresses given by me)

When going out of home, I normally take up to 2 devices with me and connect to the ones at home through the Tailscale IP

Usually I do this by typing the IP address manually on either scenario, if I’m home I connect typing the LAN IP Addresses for the devices, otherwise I manually type the Tailscale IP addresses

I would like to now optimize this process using Host Names; I would like to type in say, SSH pc1 and that connect via LAN IP if available, and otherwise fallback to Tailscale IP if not

Result being I can just type the one singular host name, and connect successfully regardless if I’m home or not, also using the best possible connection (LAN preferred over Tailscale)

I am aware Tailscale has a feature that it does this out of the box using the Tailscale IP on the same LAN, but this doesn’t seem to work on all devices (the phones) and additionally that generates some noticeable overhead given their age too

I have been reading about Avahi and thinking of using it on each device, advertising the same host name with both it’s IPs, which I am yet to try but figured I could use more input on solutions if anyone has experience with it, I’d appreciate any

Thanks for reading, and I hope you have a nice day

  • Coki91@lemmy.worldOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    I think I understand why Avahi wouldn’t work with that explanation, I keep digging and now my router is not exactly inaccessible, it’s managed by my ISP instead which is annoying but I supposedly can still ask them to tweak things for me so I may have a chance

    Tailscale already has DNS servers working on Tailnets (they call it mDNS, or magicDNS) which is I believe 100.100.100.100… actually, the documentation states that every tailscale-running device is a DNS server on itself too but either way that IP is private on every tailnet, remains accessible and host names are configurable on the Tailnet too

    If I’m not mistaken on the functioning of DNS, I should be able to do it with that primary-router secondary-tailscale DNS setup I hypothesized and on LAN that will yield perfect connectivity, while out from home there would be no such records and it’ll fall back to Tailscale’s DNS which is already private (worst concern is just sending a request for a hostname on public network but that shouldn’t be that big of a deal)

    At this point I might have this solved, but of course, more input is nice too, It’ll take some time for my ISP to work for me on this

      • Coki91@lemmy.worldOP
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        Right, I didn’t pick up on that m/multicast DNS difference, I thought I was talking about the same thing, thanks for clarification

        Sounds like I do have options here, so while I wait for my ISP to comply, I’ll also try out Avahi then