From nobody Mon Jun 26 18:35:06 2023 X-Original-To: freebsd-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 4Qqc324rx3z4k5qb for ; Mon, 26 Jun 2023 18:35:10 +0000 (UTC) (envelope-from freebsdlouisville@gmail.com) Received: from mail-oo1-xc2f.google.com (mail-oo1-xc2f.google.com [IPv6:2607:f8b0:4864:20::c2f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Qqc3212Klz46gy for ; Mon, 26 Jun 2023 18:35:10 +0000 (UTC) (envelope-from freebsdlouisville@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-oo1-xc2f.google.com with SMTP id 006d021491bc7-56368c40e8eso381223eaf.0 for ; Mon, 26 Jun 2023 11:35:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687804509; x=1690396509; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:user-agent:mime-version:date:message-id:from:from:to :cc:subject:date:message-id:reply-to; bh=9uQWOlZyPrzHyfi43ZrRUeQ5pdWSYvQDFr2qXguYQfs=; b=RBVk1mB50XTZXT1CezIB3NclTaTosUSuU6KldUc88k91o6viqQeUOKPjtvgrrV3jxm R/64K/agY7Y98tykDgrrqZ2IaZjA8brro7/PakYCtaHIQHQn4FfvKW7S8UBpOZLgQpdE DEIGq3bCVJtn4T8NnECEXBmNHOOJ5ZtyWeVjs5nwDH6umI0Y8mFYsyr3P8ciHqRvt9uM IzY75fLkoEl1yHn0V9/6S61jeCdGHWM7VQc58NySrpG4M2fz+7kp/ckhzF7eT0vlMbD4 liCjke4fVrbEodsgYv3hNF/Yr702l99DpEsXEKYZt6TXEtR7Jtzvniil6JptlarZPtps lzKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687804509; x=1690396509; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:user-agent:mime-version:date:message-id:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9uQWOlZyPrzHyfi43ZrRUeQ5pdWSYvQDFr2qXguYQfs=; b=HMWUcndjKjoiQJroJnlvVp8x1EPdEQmbOcsJK1yz7nXQQnfV5sUtCReTh4M2nsU5Yy VxAQrxc5AHUdHwbqUjpHwKxOcjVBqp9QW0bA4teuRRQG9Ux47FFIAy8Bd49BdrggrfQB RZlw2mLWnYWx5rtQel+tF948n4oacveKmQIEbzWxhGtmYUoMYreyII8WDO+TuEQsCI8O HHOt32ASj6oEzgkHVf6bfofK6u848IYhHtmorsv8tDS41Dmsb6JBRgxeYExoR7q/ZAJW ng8oroNoWK5mjjHMES8I039KB3rEi87o+O69JwoN0jX8fdNSdH5rbs1+aGXpkt6QipnW BydA== X-Gm-Message-State: AC+VfDzKeZdahLBpJwRrXqBB50u2r3Q6E0KtcyKogR0gz+OMPrhorRaK mWUNLhsI1vw22ZlDP5dB7rJT47hVt4m2ew== X-Google-Smtp-Source: ACHHUZ7iYD1AX8zmi8qrajCBIjJ7Bsdf8LPndYA6p51Wjbn4ZzxjwlpGYgEoEw1kBWS+AXN1vB9Hcg== X-Received: by 2002:a05:6358:5197:b0:132:fe11:698a with SMTP id 23-20020a056358519700b00132fe11698amr3717640rwk.15.1687804508816; Mon, 26 Jun 2023 11:35:08 -0700 (PDT) Received: from [192.168.2.15] (34.sub-75-221-217.myvzw.com. [75.221.217.34]) by smtp.gmail.com with ESMTPSA id a21-20020ac844b5000000b00400aa16bf38sm1291606qto.82.2023.06.26.11.35.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Jun 2023 11:35:08 -0700 (PDT) From: Steven Friedrich X-Google-Original-From: Steven Friedrich Message-ID: <6c840288-0446-122d-7d97-d6b02982e27c@Gmail.com> Date: Mon, 26 Jun 2023 14:35:06 -0400 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 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: Using /etc/hosts, not dns To: freebsd@vanderzwan.org Cc: FreeBSD Questions Mailing List References: <846f37ec-c0b3-0b1a-6294-1da6a9260777@Gmail.com> <1ED24C4A-FABF-4096-970D-4017616FC124@vanderzwan.org> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4Qqc3212Klz46gy X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N Correct, Linux still works. After all these years and my extensive Unix experience, I am abandoning FreeBSD. You have completely abandoned common sense. On 6/26/23 1:08 PM, freebsd@vanderzwan.org wrote: > > Hi > >> On 26 Jun 2023, at 15:50, Steven Friedrich wrote: >> >> BTW, this anomaly only happens on my Raspberry Pi 4B (debian) and FreeBSD. >> Works as historically worked on Linux Mint and KDE Neon. >> > > I have been using getent in Solaris since the 90s, before Linux even existed and history section of getent mentions: > > HISTORY > A getent command appeared in NetBSD 3.0, and was imported into > FreeBSD 7.0. It was based on the command of the same name in Solaris and > Linux. > > So I suspect Linux Mint and KDE Neon might be the anomalies ;-) > > Cheers > Paul > > > >> On 6/26/23 4:58 AM, freebsd@vanderzwan.org wrote: >>> Hi >>>> On 25 Jun 2023, at 22:51, Steven Friedrich 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) >>>> >>> Man page for host command starts with: >>> NAME >>> host - DNS lookup utility >>> So that means it specifically queries DNS, just like nslookup. >>> To use the normal lookup methods configured in /etc/nsswitch.conf you should use the getent command: >>> NAME >>> getent - get entries from administrative database >>> SYNOPSIS >>> getent database [key ...] >>> So 'getent hosts slimline’ should give you the result you want. >>> Cheers, >>> Paul >>>> Here's the /etc/hosts: >>>> >>>> # $FreeBSD$ >>>> # >>>> # Host Database >>>> # >>>> # This file should contain the addresses and aliases for local hosts that >>>> # share this file. Replace 'my.domain' below with the domainname of your >>>> # machine. >>>> # >>>> # In the presence of the domain name service or NIS, this file may >>>> # not be consulted at all; see /etc/nsswitch.conf for the resolution order. >>>> # >>>> # >>>> ::1 localhost localhost.Friedrich.org >>>> 127.0.0.1 localhost localhost.Friedrich.org >>>> 127.0.1.1 Slimline.Friedrich.org >>>> # >>>> # Imaginary network. >>>> #10.0.0.2 myname.my.domain myname >>>> #10.0.0.3 myfriend.my.domain myfriend >>>> # >>>> # According to RFC 1918, you can use the following IP networks for >>>> # private nets which will never be connected to the Internet: >>>> # >>>> # 10.0.0.0 - 10.255.255.255 >>>> # 172.16.0.0 - 172.31.255.255 >>>> # 192.168.0.0 - 192.168.255.255 >>>> # >>>> # In case you want to be able to connect to the Internet, you need >>>> # real official assigned numbers. Do not try to invent your own network >>>> # numbers but instead get one from your network provider (if any) or >>>> # from your regional registry (ARIN, APNIC, LACNIC, RIPE NCC, or AfriNIC.) >>>> # >>>> # local additions >>>> 192.168.1.1 Verizon Internet >>>> 192.168.2.1 RAX80 Netgear router >>>> 192.168.2.2 NAS WDMyCloudEX2Ultra >>>> 192.168.2.3 Brother laser >>>> 192.168.2.4 AppleTV >>>> 192.168.2.5 HP-ENVY >>>> 192.168.2.6 PS5 >>>> 192.168.2.7 PS4 >>>> 192.168.2.9 Slimline.Friedrich.org Slimline >>>> 192.168.2.10 Pi4B >>>> 192.168.2.11 Dell Inspiron3668 MATE Cinnamon Neon Xfce PCLinux >>>> 192.168.2.12 iPhone >>>> 192.168.2.15 XPS XPS-9320 laptop >>>> >>>> and /etc/resolv.conf >>>> # Generated by resolvconf >>>> nameserver 192.168.2.1 >>>> >>>> nameserver 127.0.0.1 >>>> options edns0 >>>> >>>> and /etc/nsswitch.conf >>>> >>>> # >>>> # nsswitch.conf(5) - name service switch configuration file >>>> # $FreeBSD$ >>>> # >>>> group: compat >>>> group_compat: nis >>>> hosts: files dns >>>> netgroup: compat >>>> networks: files >>>> passwd: compat >>>> passwd_compat: nis >>>> shells: files >>>> services: compat >>>> services_compat: nis >>>> protocols: files >>>> rpc: files >>>> >>>> Why won't host lookup slimline in /etc/hosts? >>>> -- >>>> FreeBSD slimline.friedrich.org 13.2-RELEASE-p1 FreeBSD 13.2-RELEASE-p1 GENERIC amd64 >>>> SLIMLINE is GENERIC with unnecessary drivers removed >>>> /usr/ports/.git/HEAD >>>> ref: refs/heads/2023Q2 >>>> >> >> -- >> FreeBSD slimline.friedrich.org 13.2-RELEASE-p1 FreeBSD 13.2-RELEASE-p1 GENERIC amd64 >> SLIMLINE is GENERIC with unnecessary drivers removed >> /usr/ports/.git/HEAD >> ref: refs/heads/2023Q2 >> > -- FreeBSD slimline.friedrich.org 13.2-RELEASE-p1 FreeBSD 13.2-RELEASE-p1 GENERIC amd64 SLIMLINE is GENERIC with unnecessary drivers removed /usr/ports/.git/HEAD ref: refs/heads/2023Q2