*BSD News Article 53925


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.uwa.edu.au!classic.iinet.com.au!swing.iinet.net.au!news.uoregon.edu!newsxfer.itd.umich.edu!news.mathworks.com!news.kei.com!sol.ctr.columbia.edu!startide.ctr.columbia.edu!wpaul
From: wpaul@ctr.columbia.edu (Bill Paul)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Cannot export a filesystem to a netgroup
Date: 31 Oct 1995 19:07:36 GMT
Organization: Columbia University Center for Telecommunications Research
Lines: 86
Distribution: world
Message-ID: <475s5p$3p3@sol.ctr.columbia.edu>
References: <473l3n$1f0@no-names.nerdc.ufl.edu>
NNTP-Posting-Host: startide.ctr.columbia.edu
X-Newsreader: TIN [version 1.2 PL2]

Daring to challenge the will of the almighty Leviam00se, James F. Hranicky
(jfh@cis.ufl.edu) had the courage to say:

: Howdy,

: I have the following line in my /etc/exports file:

: /mydir -maproot=nobody cismach

: cismach is the netgroup I'm trying to export to, but when I 
: start or hup mountd I get:

: Oct 30 18:45:24 bounce-bsd mountd[20565]: Gethostbyname failed
                                            ^^^^^^^^^^^^^^^^^^^^
                                            !!!!!!!!!!!!!!!!!!!!
                                            ^^^^^^^^^^^^^^^^^^^^
                                            !!!!!!!!!!!!!!!!!!!!

_Please_ don't tell me you didn't just let this error message go
by without even _trying_ to investigate it. Go on, think about it 
for a second. Use your head: the system needs to know the IP address of
each hostname you feed it as part of the NFS access list, right?
But the netgroup database only lists host_names_, right? So it has to
do a gethostbyname() on each member of the netgroup to lookup the 
addresses, right? So what happens if it can't resolve some of the
names into addresses? You get this error message, that's what.

In other words, you have hostnames listed in the 'cismach' netgroup
that can't be properly resolved. When mountd hits the bad hostname
and discovers that there's no IP address that goes with it, it
rejects the whole netgroup (which is a bit harsh, but that's the way 
mountd is coded, so...).

Now, as to _why_ it can't resolve the hostname into an IP address, there
are several possible reasons:

1) You made a typo when you entered the names into the netgroup database.

2) You entered the name of a pseudohost that doesn't have a real IP address
   (i.e. a mail alias that has an MX record in the DNS, but no A record).

3) You don't have DNS configured correctly on the FreeBSD machine, and the
   cismach netgroup contains hostnames that don't appear in the local
   /etc/hosts file.

   Check that you have /etc/resolv.conf configured correctly and that
   /etc/host.conf is set up to use 'bind' (I always use 'hosts' first,
   then 'bind' to save wear and tear on the nameserver for often-used,
   wel-known names that appear in /etc/hosts.

: Oct 30 18:45:24 bounce-bsd mountd[20565]: Bad netgroup cismach
: Oct 30 18:45:24 bounce-bsd mountd[20565]: Bad exports list line /local -maproot
: Oct 30 18:45:24 bounce-bsd mountd[20565]: Can't open /var/db/mountdtab

: If I have a hostname instead, all seems well.

'A' hostname, sure. But have you tried _all_ the hostnames in the
netgroup to see if mountd can resolve the all? (Don't answer that:
if you had tried it, you wouldn't be here asking this question. :)

I just tested the netgroup support with mountd on my system and it
works just fine, but then I know that I have DNS working correctly
and that my netgroup database has only valid hosts in it.

: I put a + in 
: /etc/netgroup as per the man page, but it still doesn't seem
: to like my netgroups (this isn't the only one it does this on).

Then you either have a really goofy netgroup database, or your DNS
isn't working correctly.

: Any ideas?

Yes: check your netgroup database for typos and make sure DNS is working.

-Bill

--
=============================================================================
-Bill Paul            (212) 854-6020 | System Manager
Work:         wpaul@ctr.columbia.edu | Center for Telecommunications Research
Home:  wpaul@skynet.ctr.columbia.edu | Columbia University, New York City
=============================================================================
License error: The license for this .sig file has expired. You must obtain
a new license key before any more witty phrases will appear in this space.
=============================================================================