4 ms·
Does anyone know how one might do “automagic FQDNS“? At home, at any given time I might have around 10 or so Linux or BSD VMs across my laptop, Synology or Ras
by sigjuice 6y ago
Does anyone know how one might do “automagic FQDNS“?
At home, at any given time I might have around 10 or so Linux or BSD VMs across my laptop, Synology or Raspberry Pi’s. I’d like them to know each other’s names (even if they are not all directly reachable via IP). I really really hate typing or copy/pasting IP addresses.
- Sean-Der 6y agoIf they are in the same subnet you could use mDNS! I use it for my NASes and Linux desktops and it works great. `ssh seanlaptop.local` is much better then having to ping broadcast or log into the router :)
- sigjuice 6y agoAs mentioned, they can't reach each other over IP so they are not on the same subnet (e.g. I prefer NAT for my VMWare Fusion VMs). mDNS has not been reliable in my experience, even between a collection of macOS and Linux systems. Also, the OpenBSD and musl libc resolvers don't even speak mDNS.
- tedunangst 6y agoMost devices send their hostname in the dhcp request. Which gets recorded in the dhcpd.leases file or wherever. Take that info, add it to DNS zone file or wherever.
- paxswill 6y agoA sibling comment mentions mDNS, which can work but sometimes requires an extra package. The simpler solution is to connect your DHCP and DNS servers. Dnsmasq has this built in, and is frankly a fantastic piece of software. If you’re sticking with ISC servers, BIND can be configure to allow dynamic DNS updates, and dhcpd can in turn be configured to manage those updates.
- takeda 6y agoI set up something like that long time ago with bind + isc-dhcp. You configure the domain and enable nsupdate on it with a key. Then configure DHCPd to use that key to populate the domain with hosts. Edit: This is roughly how it is configured: https://unix.stackexchange.com/questions/265142/isc-dhcpd-to-register-or-update-bind-dns-with-client-hostname https://unix.stackexchange.com/questions/265142/isc-dhcpd-to... If you use different dns/dhcp tools it might be done differently.