Re: Using /etc/hosts, not dns
- In reply to: Dan Mahoney (Ports): "Re: Using /etc/hosts, not dns"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 26 Jun 2023 03:36:58 UTC
On 26 June 2023 12:47:15 pm AEST, "Dan Mahoney (Ports)" <freebsd@gushi.org> wrote: > > On Jun 25, 2023, at 1:51 PM, Steven Friedrich > <freebsdlouisville@gmail.com> wrote: > > > > I have been using /etc/hosts for decades to identify local hosts. > I don't want the complexity of dns for this simple scenario. > > > > I issue: host slimline > > Host slimline not found: 3(NXDOMAIN) > > > > Here's the /etc/hosts: [...] > > ::1 localhost localhost.Friedrich.org > > 127.0.0.1 localhost localhost.Friedrich.org > > 127.0.1.1 Slimline.Friedrich.org [...] > > 192.168.2.9 Slimline.Friedrich.org Slimline > > Why won't host lookup slimline in /etc/hosts? > Because you also have to put it in /etc/hosts as its shortname, as > the two “localhost” examples above should have suggested. And from the second entry it would appear to be case-sensitive, though hosts(5) makes no such mention? But then, is a second entry with a different IP address meaningful anyway? cheers, Ian