On Sat, Nov 12, 2016 at 08:50:46AM -0700, Glenn English wrote: > > On Nov 12, 2016, at 3:25 AM, Andy Smith <a...@strugglers.net> wrote: > > I am 95% confident that the reason that Glenn's system thinks the > > FQDN is "www.slsware.dmz" is because the first instance of "srv" in > > the /etc/hosts is: > > > >>> 192.168.2.203 www.slsware.dmz wsd srv
> But that isn't the first; it's the fourth. A grep of the hosts file: Andy is correct. The line that Andy cited is the first instance of the name "srv" as a SEPARATE WORD all unto itself. > > root@srv:~# egrep srv /etc/hosts > > 127.0.0.1 srv.slsware.org Does not contain "srv" as a whole word. > > 216.17.203.66 srv.slsware.org sso Does not contain "srv" as a whole word. > > # 192.168.2.203 srv.slsware.dmz srv Is a comment. Ignored. > > 192.168.2.203 www.slsware.dmz wsd srv THIS one contains srv as a whole word. So when you do your "hostname -f" (which I still contend is a rubbish command which serves no useful purpose, but it's what you seem to want, so I'll roll with it), it looks up "srv" in this file as a whole word/field, and finds this line as the first match. Therefore hostname -f writes "www.slsware.dmz" to stdout. > > 192.168.2.203 mail.slsware.dmz msd srv > > 192.168.2.203 ntp.slsware.dmz ntp srv > > 192.168.2.203 ns1.slsware.dmz ns1d ns1 srv This is just nonsense. You've got the whole word "srv" in the file multiple times. But it can't resolve to multiple FQDNs using the "hostname -f" resolution mechanism, which only returns the first match. The "srv" on these lines is just noise. I concur with the previous advice to stop using /etc/hosts for this configuration, and move everything into DNS. Here's my entire /etc/hosts file from my Internet-facing VPS (originally imaged by the VPS provider as squeeze, which I have upgraded to wheezy): greg@remote:~$ cat /etc/hosts fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 127.0.0.1 localhost.localdomain localhost # Auto-generated hostname. Please do not remove this comment. 199.231.184.176 remote.wooledge.org remote ::1 localhost ip6-localhost ip6-loopback This machine acts as a web server for "wooledge.org" and "mywiki.wooledge.org" and yet neither of those names appears in /etc/hosts. Why should they? They are only meaningful to the web server. They are defined in DNS.