From owner-freebsd-net@freebsd.org Sat Jun 15 05:52:58 2019 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62D3315BD06B for ; Sat, 15 Jun 2019 05:52:58 +0000 (UTC) (envelope-from rfg@tristatelogic.com) Received: from outgoing.tristatelogic.com (segfault.tristatelogic.com [69.62.255.118]) by mx1.freebsd.org (Postfix) with ESMTP id E60148F6C9 for ; Sat, 15 Jun 2019 05:52:56 +0000 (UTC) (envelope-from rfg@tristatelogic.com) Received: by segfault.tristatelogic.com (Postfix, from userid 1237) id 859F04E649; Fri, 14 Jun 2019 22:52:49 -0700 (PDT) From: "Ronald F. Guilmette" To: freebsd-net@freebsd.org Subject: localhost woes -- help requested MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2825.1560577969.1@segfault.tristatelogic.com> Date: Fri, 14 Jun 2019 22:52:49 -0700 Message-ID: <2826.1560577969@segfault.tristatelogic.com> X-Rspamd-Queue-Id: E60148F6C9 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of rfg@tristatelogic.com designates 69.62.255.118 as permitted sender) smtp.mailfrom=rfg@tristatelogic.com X-Spamd-Result: default: False [-6.08 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[tristatelogic.com]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-2.90)[ip: (-7.62), ipnet: 69.62.128.0/17(-3.81), asn: 14051(-2.99), country: US(-0.06)]; MX_GOOD(-0.01)[mx1.tristatelogic.com]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:14051, ipnet:69.62.128.0/17, country:US] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jun 2019 05:52:58 -0000 I've recently completed a long overdue upgrade from FreeBSD 9.1 to 12.0. And when I say "completed" that isn't 100% accurate, as there are still a couple of remaining things I can't quite seem to make work properly. Both of these, perhaps coincidentally, have to do with the magic name "localhost". I can't for the life of me figure out what I've done wrong so I am asking for help. First I should probably explain where I have been already, as that may help to shed light on the problem. I installed and configured my new 12.0 system on a different (Intel- based) machine at first. Got almost everything I need installed and working on that hardware before, as a last step, pulling the hard drive out of that system and sticking in into the AMD-based system which will be its final home. Two things that definitely worked before I swapped the hard drive to its new home were the Firefox and Opera browsers. (I know. I checked.) Once I had the drive installed on the AMD system, I had to make a small diddle to /etc/rc.conf to enable the AMD Kernel Mode Switching graphics driver. But other than that, everything remained pretty much as it was. The only other thing I did was to tun on ipfw. It took me awhile to get my ipfw rules all the way I want them, but now everything is running peachey again... ... except for the browsers, and also one other thing (nmh outbound email handling). Now, both Firefox and Opera crash and burn, right out of the gate, when started from the command line. In both cases thet do so both with entirely cryptic failure messages. But here's the kicker... I futzed around with this awhile and found out that if I just change the default value of the DISPLAY environment variable from "localhost:0.0" to ":0.0" then both browsers *do* then start up successfully from the command line. So, um, what the bleep did I do wrong? Here's the output of the command "getent hosts localhost": ::1 localhost 127.0.0.1 localhost localhost.tristatelogic.com This output also seems pretty entirely bizzare to me, because at some point, while trying to debug this problem, I came to the theory that perhaps it was all of this darned IPv6 stuff that was causing all of the problems. So I edited my local /etc/hosts file and I actually COMMENTED OUT the line that defined an IPv6 address for localhost. And yet, ever after I commented out the /etc/hosts line that defines an IPv6 address for "localhost" *and* then rebooting, I am *still* getting the above output from getent which is still showing an IPv6 address for localhost !?!? So, I mean, what the hay??? I have zero comptrehension of whay this might be the case, and if someone could explain it to me, I would be eternally greatful. Oh! And by the way, the relevant line from my /etc/nsswitch.conf file is as follows: hosts: files dns mdns I had assumed that "files" meant /etc/hosts. No? It now appears, maybe not, since my manual edits to that file appear to have no effect whatsoever. One last thing... I also have run into -another- problem that also seems related to the resolution... or lack thereof... of the name "localhost". That name is also used in the default NMH configuration file called /usr/local/etc/nmh/mts.conf wherein it is supposed to designate what mail server the NMH mail client should try to connect to when it needs to send outbound mail. Well, believe me, the Postfix mail server is up and running on this (AMD) machine, and its doing its job flawlessly. And it is answering to "telnet 127.0.0.1 25" just like it should. HOWEVER, regardless of that, when I go to send some outbound mail using the NMH mail client, I am getting an error saying that NMH can't connect to "localhost". I am totally unable to understand or explain that also/either. I don't know if this NMH problem is even related to the problem with the browsers. They apparently are having trouble connecting to the X server on "localhost"... but it seems like the two problems might be related in some way, and might all have to do with some resolution problem relating to this blasted name "localhost". Any hints for how I can debug this mess would be appreciated. Regards, rfg P.S. I actually do know my way around DNS fairly well, but none of this is DNS related, per se. "localhost" is not an FQDN, and it isn't in any DNS zone file that I am aware of.