From nobody Tue Jun 27 01:38:26 2023 X-Original-To: questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QqnRh70XBz4kDY1 for ; Tue, 27 Jun 2023 01:38:40 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: from be-well.ilk.org (be-well.ilk.org [23.30.133.173]) by mx1.freebsd.org (Postfix) with ESMTP id 4QqnRg4bj0z3PdB for ; Tue, 27 Jun 2023 01:38:39 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of freebsd-questions-local@be-well.ilk.org has no SPF policy when checking 23.30.133.173) smtp.mailfrom=freebsd-questions-local@be-well.ilk.org; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=ilk.org (policy=none) Received: from lowell-Ubuntu.lan (lowell-Ubuntu.lan [172.30.250.95]) by be-well.ilk.org (Postfix) with ESMTP id 8523821409 for ; Mon, 26 Jun 2023 21:38:26 -0400 (EDT) Received: by lowell-Ubuntu.lan (Postfix, from userid 1147) id 3DB981080107; Mon, 26 Jun 2023 21:38:26 -0400 (EDT) From: Lowell Gilbert To: questions@freebsd.org Subject: Re: Using /etc/hosts, not dns References: <846f37ec-c0b3-0b1a-6294-1da6a9260777@Gmail.com> <1ED24C4A-FABF-4096-970D-4017616FC124@vanderzwan.org> <6c840288-0446-122d-7d97-d6b02982e27c@Gmail.com> <20230626194054.6a3119f50513650f249b2312@sohara.org> Date: Mon, 26 Jun 2023 21:38:26 -0400 In-Reply-To: <20230626194054.6a3119f50513650f249b2312@sohara.org> (Steve O'Hara-Smith's message of "Mon, 26 Jun 2023 19:40:54 +0100") Message-ID: <44y1k5n0q5.fsf@be-well.ilk.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain X-Spamd-Result: default: False [-2.89 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.995]; NEURAL_HAM_SHORT(-0.99)[-0.991]; RCVD_NO_TLS_LAST(0.10)[]; DMARC_POLICY_SOFTFAIL(0.10)[ilk.org : No valid SPF, No valid DKIM,none]; MIME_GOOD(-0.10)[text/plain]; R_DKIM_NA(0.00)[]; R_SPF_NA(0.00)[no SPF record]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:7922, ipnet:23.30.0.0/15, country:US]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[questions@freebsd.org]; RCVD_COUNT_THREE(0.00)[3]; RCPT_COUNT_ONE(0.00)[1]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[questions@freebsd.org]; TO_DN_NONE(0.00)[]; ARC_NA(0.00)[] X-Rspamd-Queue-Id: 4QqnRg4bj0z3PdB X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N Steve O'Hara-Smith writes: > On Mon, 26 Jun 2023 14:35:06 -0400 > Steven Friedrich wrote: > >> Correct, Linux still works. After all these years and my extensive Unix >> experience, I am abandoning FreeBSD. You have completely abandoned >> common sense. > > The host command has been specified to only use DNS for as long as > it has existed. If there's an implementation of host that reads the hosts > file then it is that implementation which is anomalous not the FreeBSD one. And it's documented to be a DNS lookup utility on my (Ubuntu) Linux system also. But that version also first gives a result from /etc/hosts, in the form: theserver has address 172.30.250.1 It looks like the Ubuntu host(1) program comes from ISC, just like the one in the bind-tools package on FreeBSD, but it's been modified to check /etc/hosts as well. I suspect that Linux distributions vary on this, although I'm too lazy to go around checking. I don't think this is necessarily a bad piece of functionality, but given that host(1) is specifically a DNS lookup tool, it should definitely indicate when it is giving results that don't come from doing a DNS lookup. As far as I know, "host" is not a POSIX standard command, so it can be anything its host (no pun intended) system wants it to be. However, all of the versions I can find (easily) either come from the ISC codebase or are trying to imitate ISC, so I think it's only reasonable to assume that its results reflect a DNS query. My take is that what the original poster expects isn't unreasonable, but people with that superficial an understanding of how things work probably shouldn't be editing /etc/hosts in the first place. Be well.