You probably already have this. Nearly every ISP has been delivering home gateways with DHCP and DNS built in, and DHCP-registration into the local DNS cache. So <your-computer>.lan or <your-computer>.home are likely candidates. Check your settings to find out.
Besides DNS-based naming there is Multicast DNS (Bonjour/Avahi/ZeroConf) and NetBIOS naming (which still exist and works on most operating systems that have Samba or something similar).
In any case, you don't need a remote service like Cloud9 or Tailscale to any of this. Normal networking has done this for decades.
The next step beyond this is running a more capable DNS system in your home network. Generally this takes the shape of a DNS forwarder service running on a router or server. It could be as simple as a PiHole or OpnSense firewall, or however complicated you might want to make it.
You can use mDNS [0] to publish an internal domain to others on the same LAN. Alternatively, you can use something like a Pi-Hole [1] to be the DNS server for your LAN. Pi-Hole gives you GUI way to point any domain to any IP [2].
Not the OP, but for a small local network it is easy enough to sneakernet hosts files around. (On a USB drive if not a properly classic floppy.)
Also, somepcname.local mDNS works on most operating systems today (once you grant firewall permissions to it; for instance, on Windows setting your home network as a "Private" network for instance when it asks Public or Private).
We have a lot of computers, so DNS is easier than hosts files (also easier for dynamic updates,e.g. random Pi's given a hostname will update DNS via DHCP so no need to find the IP address and update other hosts).
It runs DNS and DHCP as well (so we have a domain that's the same as the house name); the DNS is primarily caching so for most sites it's just stock internet (except a bit faster due to the caching). It's also authoritative for a small number of domains that serves ads/do tracking (it's amazing how much better that makes the internet, even the kids comment on how fast it is compared to their friends - and we're out in the sticks on a relatively slow connection).
This might be an overkill, but you can host internal domain using public DNS.
I've got a domain, and I've added multiple A records pointing to IPs of servers in my 192.168.X.Y NAT. This has a downside thought, that with short enough TTL, you may not be able to access your server during intermittent connectivity problems.
I'm using letsencrypt through traefik for the certs.
I personally use avahi (mDNS) as many other replies have suggested.
I use NixOS, so it was easy to make a function to abstract over the config. In each computer's config, all I do is specify a hostname. This function does the work (or really, some nixpkgs committer did):
- desired hostname and search domain(can be bogus though not recommended)
- DHCP server parameters with the router's IP as primary DNS
- DHCP static assignment for (each of)server(s)
- DNS static assignment such as "yourserver.bogusdomain.tld 192.168.10.10"
- (optionally) domain names, ddclient, certbot
"Proper" classical router/firewall OSs like Cisco IOS, Juniper JunOS, VyOS, RouterOS, OpenWrt, all easily do it like they do a cigarette, but good gamer routers and some NASs also can do it okay in many cases.
you'd have to edit the hosts file on every single device you want to access that domain. personally, i wouldn't even know how to do that on any of my mobile devices.
Network router with DNS resolver, internal domain, all DHCP clients get registered with a name as a subdomain. mycomputer.networkname.lan - I use pfsense, but lots of others support this.
oneplane|3 years ago
Besides DNS-based naming there is Multicast DNS (Bonjour/Avahi/ZeroConf) and NetBIOS naming (which still exist and works on most operating systems that have Samba or something similar).
In any case, you don't need a remote service like Cloud9 or Tailscale to any of this. Normal networking has done this for decades.
The next step beyond this is running a more capable DNS system in your home network. Generally this takes the shape of a DNS forwarder service running on a router or server. It could be as simple as a PiHole or OpnSense firewall, or however complicated you might want to make it.
aendruk|3 years ago
leesalminen|3 years ago
[0] https://wlog.viltstigen.se/articles/2021/05/02/mdns-for-linu...
[1] https://pi-hole.net
[2] https://docs.callitkarma.me/posts/PiHole-Local-DNS/
WorldMaker|3 years ago
Also, somepcname.local mDNS works on most operating systems today (once you grant firewall permissions to it; for instance, on Windows setting your home network as a "Private" network for instance when it asks Public or Private).
zh3|3 years ago
zh3|3 years ago
ecliptik|3 years ago
1. https://tailscale.com/kb/1054/dns/
2. https://tailscale.com/kb/1153/enabling-https/
aljarry|3 years ago
I've got a domain, and I've added multiple A records pointing to IPs of servers in my 192.168.X.Y NAT. This has a downside thought, that with short enough TTL, you may not be able to access your server during intermittent connectivity problems.
I'm using letsencrypt through traefik for the certs.
whateveracct|3 years ago
I use NixOS, so it was easy to make a function to abstract over the config. In each computer's config, all I do is specify a hostname. This function does the work (or really, some nixpkgs committer did):
numpad0|3 years ago
- desired hostname and search domain(can be bogus though not recommended)
- DHCP server parameters with the router's IP as primary DNS
- DHCP static assignment for (each of)server(s)
- DNS static assignment such as "yourserver.bogusdomain.tld 192.168.10.10"
- (optionally) domain names, ddclient, certbot
"Proper" classical router/firewall OSs like Cisco IOS, Juniper JunOS, VyOS, RouterOS, OpenWrt, all easily do it like they do a cigarette, but good gamer routers and some NASs also can do it okay in many cases.
vorpalhex|3 years ago
tomcam|3 years ago
kroltan|3 years ago
(How would you even add hosts to an iPhone or something?)
dylan604|3 years ago
timc3|3 years ago
You could have your own top level domain as well.
jrnichols|3 years ago
pclmulqdq|3 years ago