> On Nov 11, 2016, at 9:58 PM, Andy Smith <a...@strugglers.net> wrote:
> 
> I normally put the short name in /etc/hostname and then the:
> 
> <IP address>    <FQDN> <short name>
> 
> in /etc/hosts. That works for me both for setting initial host name
> and FQDN, and for changing it later.

Yeah, that's what I hear, and exactly that's in there. IIRC, I've had some 
success with that in the past. But it doesn't work for me today. Debian needs a 
domainname command like hostname. Or maybe a man page explaining what looks up 
what and where the string is. A file in /etc called domainname wouldn't be too 
much to ask, IMHO.

> After you have done that, what command are you using which shows you
> the old/incorrect values?

Mostly hostname - f. That's what I've used in a number if shell scripts, and 
it's always worked (on systems who've been labeled by the installer). hosts and 
DNS can both find the IP, given the FQDN, but hostname -f is wrong. hostname 
returns 'srv' like it should. But hostnane -f returns 'www.slsware.dmz' -- way 
wrong. I've grep'ed for that www string and haven't been able to find it.

> Note that the domain part comes from name resolution, so will
> involve /etc/hosts and potentially DNS or other name services you
> have configured in /etc/nsswitch.conf.

I haven't done nsswitch.conf yet. I'll try it in the morning...

I got curious. nsswitch.conf on the old host (working hostname -f):

> passwd:         compat
> group:          compat
> shadow:         compat
> 
> hosts:        files  dns 
> networks:       files
> 
> protocols:      db files
> services:       db files
> ethers:         db files
> rpc:            db files
> 
> netgroup:       nis


On the new one (bent hostname -f):

> passwd:         compat
> group:          compat
> shadow:         compat
> gshadow:        files
> 
> hosts:        files dns
> networks:       files
> 
> protocols:      db files
> services:       db files
> ethers:         db files
> rpc:            db files
> 
> netgroup:       nis

See anything interesting? I don't. Except the mention of gshadow on the bad 
one, and I have no idea what that makes happen. Is it possible one of those 
files has bad data in it? If so, what are their names and where are they?

-- 
Glenn English




Reply via email to