Remix.run Logo
gausswho 4 days ago

While I've got some eyeballs on the subject, I'm tiring of mistyping this across my local network devices. How many of you folks alias this, and in what way? /etc/hosts works for my *nix machines, but not my phones, I think?

I'm also tired of remembering ports, if there's a way of mapping those. Should I run a local proxy?

n4bz0r 4 days ago | parent | next [-]

> I'm also tired of remembering ports, if there's a way of mapping those. Should I run a local proxy?

If we're talking web-services - absolutely. I put Caddy in front of everything just to be able to simply use domains. You can also use it to map ports to either standard or more convenient ones if that suffices. Configuring reverse-proxy with Caddy [0] takes just a few lines:

  http://some-service.internal {
      reverse-proxy localhost:12345
  }
After setting up a reverse-proxy or two you might want to expand your infrustructure with the following to to neaten thing up even more:

- DNS-server: most routers can be that; another easy option would be PiHole.

- DHCP-server: same as above (PiHole does DHCP too).

- Reverse-proxie(s): you can have either just one for the entire network or a number closer to the amount of services if you choose to have HTTPS between everything. Wouldn't bother with Nginx for that unless there is a strong incentive.

- ACME-server: provides the certs for the local reverse-proxies if you choose to have HTTPS between everything. Caddy can also act as a very easy to set up ACME-server [1].

If you have all that set up, you can access all the local services securely and via readable URLs. Given all the services get their certs from the ACME-server, the consumers only need to trust (install) one root cert in order to consider all the local connections secure.

Might seem like a lot at first, but the configuration is fairly straightforward and I found it's worth the effort.

[0]: https://caddyserver.com/docs/caddyfile/directives/reverse_pr...

[1]: https://caddyserver.com/docs/caddyfile/directives/acme_serve...

denkmoon 4 days ago | parent | prev | next [-]

DNS obviously. It’s easy, don’t let memes put you off.

For port mapping depends what specifically you’re aiming for. SVCB/HTTPS records are nice for having many https servers on a single system.

somat 4 days ago | parent | prev | next [-]

DNS (queue the "now you have two problems" meme)

Theoretically SRV records can be set in dns to solve the port issue, realistically Nothing uses them so.... You are probably out of luck there. The way SRV records work is you are supposed to ask a network "Where is the foo service at?"(SRV _foo._tcp.my.network.) and dns sez "it's at these machines and ports" (SRV 1(pri) 1(weight) 9980(port) misc.my.network.(target))

https://www.rfc-editor.org/rfc/rfc2782

My personal low priority project is to put mac address in DNS, I am about as far as "I could fit them in an AAAA record"

As for specific software recomendations, I am probably not a good source. I run a couple of small openbsd machines(apu-2) that serve most of my home networking needs. But, I am a sys-admin by trade, while I like it, I am not sure how enjoyable others would find the setup.

nbngeorcjhe 4 days ago | parent | next [-]

> My personal low priority project is to put mac address in DNS

There's the EUI48 rr type, but I don't know how widely supported it is

https://www.rfc-editor.org/rfc/rfc7043.html

somat 2 days ago | parent [-]

Well shit, I completely missed EUI48, there goes my excuse, time to start collecting mac address. My vague hope in storing these is it will help with dhcp setup and network host identification tooling.

I even came up with the reverse record format apparently nobody wanted. 0.0.0.0.0.0.a.b.2.e.0.9.mac.arpa.

salutes

mdaniel 4 days ago | parent | prev [-]

> realistically Nothing uses them

Depending on how one defines "nothing," they are honored by XMPP clients.

CoreDNS in Kubernetes also publishes SRV records, for any client in-cluster who wishes to look up the port number used by a named port on a v1.Service

wolrah 2 days ago | parent [-]

XMPP, SIP, Minecraft, and Outlook are the four places I've seen SRV records supported, and obviously only two of those four are widely used with a variety of clients instead of just one specific client.

Thorrez 4 days ago | parent | prev | next [-]

10.0.0.1 or 10.1.1.1 would be a bit easier to type. You could migrate there.

IAmBroom 2 days ago | parent [-]

I *guarantee* you that tech support would spend half their time figuring out that the customer typed in 1.01.1.1, instead.

Thorrez a day ago | parent [-]

I don't think gausswho needs tech support. gausswho just sometimes typos 192.168.1.1 , so I'm suggesting something that will reduce typos (not eliminate them).

t-3 4 days ago | parent | prev | next [-]

Local proxies are nice for these kinds of things, but most phones are running some kind of mDNS service so try setting up avahi/openmDNS to advertise services.

akerl_ 4 days ago | parent | prev | next [-]

I just stick all my DNS records in a normal DNS server. In my case I’m terraforming some Route53 zones. So I havd a subdomain off a real domain I own that I use for LAN gear and they all have real DNS.

For ports, anything that can just be run on 443 on its own VM, I do that. For things that either can’t be made to run on 443, or can’t do their own TLS, etc, I have a VM running nginx that handles certificates and reverse proxying.

jerkstate 4 days ago | parent | prev [-]

mDNS works well for names on your local network, you can integrate it with your dhcp server, works on hosts and phones. I don't have a good answer for ports.

mdaniel 4 days ago | parent [-]

mDNS is like the LLM of DNS: sometimes, for some audiences, it works well, but when it doesn't work you're SoL trying to fix it other than "have you tried $(sudo killall -INT mDNSResponderHelper)?"

I'm not aware of any DHCP change needed for that, since to the very best of my knowledge mDNS is a broadcast protocol. Involving DHCP would be pointing it at the copy of dnsmasq running on your router, such that the hostname that the devices present to DHCP are then resolved by dnsmasq, no mDNS required