On Sat 16 Apr 2016 at 22:14:29 (-0700), Dan Hitt wrote: > In my local network, the machines generally know each other by names like > first_host.local > second_host.local > third_host.local > ... > > So if i'm on first_host, i can ssh to second_host with > ssh my_account@second_host.local > and i can ping second_host by > ping second_host.local > > I would like to drop the '.local' because it's an extra six characters > with absolutely no value. > > In principle, i think it should be possible to by just adding > search local > to my /etc/resolv.conf, but this absolutely does not work. (I imagine that > local is a really magic name in some contexts but not very magic in others.)
If your router is ISP-provided, it's probably cheap, therefore lacking a DNS server, so only routable domains can be looked up on your WAN nameserver. (Local isn't routable.) > Furthermore, /etc/resolv.conf doesn't want to be written, as it > says it is generated automatically, so even if it worked, it wouldn't > be such a good solution. > > I can sort of fix the situation by editing ~/.ssh/config and adding lines > Host second_host > Hostname second_host.local > but this has the disadvantage that i have to do it for every host on > the network, and it only affects ssh --- ping and presumably every > other command (naturally!) do not consult this file. > > (I don't have any influence over my router which comes from > my service provider, but i wouldn't want to change it even if > i could, since i'm just asking my own machine to intercept > a name like second_host and convert it to second_host.local > before processing further.) Obviously we don't know what sort of router you have. Does it have a range of addresses which is does not (or can be told not to) serve with DHCP? Can you deduce this range by seeing what IP addresses you *do* get served with? Eg, if all your hosts are 192.168.1.32, 192.168.1.33, 192.168.1.34,... then it's possible that configuring a machine as venus=192.168.1.12 will just *work*. In which case you can put all your hosts into /etc/hosts as static addresses, and leave the network name blank. Cheers, David.