From nobody Mon Jun 26 02:47:15 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 4QqC1c6pMVz4hR0r for ; Mon, 26 Jun 2023 02:47:32 +0000 (UTC) (envelope-from freebsd@gushi.org) Received: from prime.gushi.org (prime.gushi.org [IPv6:2620:137:6000:10::142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "prime.gushi.org", Issuer "RapidSSL Global TLS RSA4096 SHA256 2022 CA1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QqC1c5g4Xz41Tt for ; Mon, 26 Jun 2023 02:47:32 +0000 (UTC) (envelope-from freebsd@gushi.org) Authentication-Results: mx1.freebsd.org; none Received: from smtpclient.apple ([149.20.66.196]) (authenticated bits=0) by prime.gushi.org (8.16.1/8.16.1) with ESMTPSA id 35Q2lQgc036385 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 25 Jun 2023 19:47:27 -0700 (PDT) (envelope-from freebsd@gushi.org) DKIM-Filter: OpenDKIM Filter v2.10.3 prime.gushi.org 35Q2lQgc036385 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gushi.org; s=prime2014; t=1687747649; bh=5mRE7//cXEsB/rhcRiGWTq7IeRY3wVJpUts38wdckR0=; h=Subject:From:In-Reply-To:Date:Cc:References:To; z=Subject:=20Re:=20Using=20/etc/hosts,=20not=20dns|From:=20"Dan=20M ahoney=20(Ports)"=20|In-Reply-To:=20<846f37ec-c 0b3-0b1a-6294-1da6a9260777@Gmail.com>|Date:=20Sun,=2025=20Jun=2020 23=2019:47:15=20-0700|Cc:=20FreeBSD=20Questions=20Mailing=20List=2 0|References:=20<846f37ec-c0b3-0b1a -6294-1da6a9260777@Gmail.com>|To:=20Steven=20Friedrich=20; b=bqOiVw72ZCuApREovcek7S567Feg0i44i7VpPHVHZQMqZPReEiSPZXtmlLO7ZFmFS JYJGjLtiojL405RYEJeR/ldDqE0ButtcMfehNzO9j/cPDqyyAu9j67T29Bwq4y9htr EkPRmI5fNiCK3P2eB8u6m4+GZydnRLpdKIu0WGz/YGLmzPyrlmdiwF21nVRNMZsuYH H0ROEXZI3TvL6CeEmpVxgWDWxmV1iR9eoC5iBSgRBxX5gk4C/JZUSL+FMxSRHbeKWF yUQkx3ec+A4L/YzzRqZgWTc98JuZu2bIJW3ouaCjteIZ8ULmtaQYjrgqxij44J/U0i hPZddG4cr5M0g== X-Authentication-Warning: prime.gushi.org: Host [149.20.66.196] claimed to be smtpclient.apple Content-Type: text/plain; charset=utf-8 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 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: Using /etc/hosts, not dns From: "Dan Mahoney (Ports)" In-Reply-To: <846f37ec-c0b3-0b1a-6294-1da6a9260777@Gmail.com> Date: Sun, 25 Jun 2023 19:47:15 -0700 Cc: FreeBSD Questions Mailing List Content-Transfer-Encoding: quoted-printable Message-Id: <198956D1-6B93-4E35-AAC9-872AC146C538@gushi.org> References: <846f37ec-c0b3-0b1a-6294-1da6a9260777@Gmail.com> To: Steven Friedrich X-Mailer: Apple Mail (2.3731.600.7) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (prime.gushi.org [149.20.68.142]); Mon, 26 Jun 2023 02:47:30 +0000 (UTC) X-Rspamd-Queue-Id: 4QqC1c5g4Xz41Tt X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:393507, ipnet:2620:137:6000::/44, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N > On Jun 25, 2023, at 1:51 PM, Steven Friedrich = wrote: >=20 > I have been using /etc/hosts for decades to identify local hosts. I = don't want the complexity of dns for this simple scenario. >=20 > I issue: host slimline > Host slimline not found: 3(NXDOMAIN) >=20 > Here's the /etc/hosts: >=20 > # $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 >=20 > and /etc/resolv.conf > # Generated by resolvconf > nameserver 192.168.2.1 >=20 > nameserver 127.0.0.1 > options edns0 >=20 > and /etc/nsswitch.conf >=20 > # > # 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 >=20 > 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 =E2=80=9Clocalhost=E2=80=9D examples above should have suggested. -Dan