From nobody Mon Jun 26 13:50:14 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 4QqTkM0y7Bz4jGDd for ; Mon, 26 Jun 2023 13:50:19 +0000 (UTC) (envelope-from freebsdlouisville@gmail.com) Received: from mail-il1-x134.google.com (mail-il1-x134.google.com [IPv6:2607:f8b0:4864:20::134]) (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 4QqTkL5qZkz3v2h for ; Mon, 26 Jun 2023 13:50:18 +0000 (UTC) (envelope-from freebsdlouisville@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-3420b22365fso19226405ab.1 for ; Mon, 26 Jun 2023 06:50:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687787417; x=1690379417; 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=U4k+QfO/7bZcYZxnFQi1O3tNYHy4DtQLMZkm3j9tXIU=; b=rinQS/ygqdaOHw+ZX1IiuMArgSWv1tpjBZR5zBxfEW+tc4LlcWGILC3jvO+4bH6asv tMnRXZXcPS6mw9IaO0p+XYrqyMiQx3LvNafdWySmntyWLN2g30ZrWJNjf/4a/MZufHOG xkay7S9+kXqvLO8LxMJcPU7WYNMOZqkpRd3ZbhC+WwYXV3GNhEJBZu3+1nWOCk7K/EM6 pKuzvgKGqQ/msAioqoxgbBKEh6sxVTBz7/6NY3DIsIqLaTCXl7pKDpwZ8RSfnD17ketD C5mmpFvMSAj1ndon24ct4jY1jNGECW/o2IYK+XKUDiBv/oz2yvU18wVRSaqMFQKiNiy3 KT7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687787417; x=1690379417; 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=U4k+QfO/7bZcYZxnFQi1O3tNYHy4DtQLMZkm3j9tXIU=; b=gd9LJbYhzSPl0a6/PL3UitjoYBrECO32xBNb/7JOYWs6CaQ+vFR/DRdlRgUUO2/fKw OVBegQ8rC81I58M2XQuxJjTsV06NXIbBT7Y9Bbp49UWMase/9Jcb/bKmnqHePosTg/bn AHNRhkJitfpIltYSJhPWg9bYnRKibJtMLj3ILDhuLoipKv9M5MnkMLXidpbaHdF9gYaL fbWww8g3lGyo+B0/gG9M2xIvs9VcKLcmMH5z3evbXXCPI+6gHgsAHmAJfFIDoOlIZFyo R5yH5uEkB65cAybIBVrwlAtZobAFJu23nHjaRepweficYi29JkZt3KbSJpaMpfx0SB4k 1hLg== X-Gm-Message-State: AC+VfDzpeM54fFNNoV7u5JwKyCDvc+4PLmY6AGwggu5y+kGYu7LHWCnS yqhRrqkeB31eJwpHV27XBakZTYgSuFLY7Q== X-Google-Smtp-Source: ACHHUZ58LkrqywzvQihoqPkpLAssFRxVFNU1gaohDPoua80cMN5Mdm+QB5qJq88O0XVReTg2yxrKkw== X-Received: by 2002:a92:d98a:0:b0:345:aba5:3780 with SMTP id r10-20020a92d98a000000b00345aba53780mr2666700iln.22.1687787416790; Mon, 26 Jun 2023 06:50:16 -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 h7-20020a92d847000000b003459d60aaeasm1270338ilq.45.2023.06.26.06.50.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Jun 2023 06:50:16 -0700 (PDT) From: Steven Friedrich X-Google-Original-From: Steven Friedrich Message-ID: Date: Mon, 26 Jun 2023 09:50:14 -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: <1ED24C4A-FABF-4096-970D-4017616FC124@vanderzwan.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4QqTkL5qZkz3v2h 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 BTW, this anomaly only happens on my Raspberry Pi 4B (debian) and FreeBSD. Works as historically worked on Linux Mint and KDE Neon. 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