We are implicitly disabling NIS (was: /etc/hosts and localhost)

Anderson Lizardo lizardo at linuxfromscratch.org
Mon Jan 19 11:40:00 PST 2004

On Monday 19 January 2004 14:32, Ryan.Oliver at pha.com.au wrote:
> > What *exactly* does the book miss of choose not to include? Sorry for >
> asking
> > millions of questions, I'm trying to understand the point of this
> > whole thread...
> We currently dont set domainname.
> Usually only used with alternative NSS mechanisms ( NIS/NIS+, LDAP
> (i think) ).

Ah, you meant the NIS/YP domain name. Indeed, we don't currently set it up. I 
must confess I didn't even know what is NIS for, so I launched Kdict and 
searched for "NIS". It means "Network Information Service". duh.

The most interesting was when I searched for "Domain Name System". See this 

        "The name resolution client (e.g. Unix's gethostbyname()
        library function) can be configured to search for host
        information in the following order: first in the local
        /etc/hosts file, second in NIS and third in DNS.  This
        sequencing of Naming Services is sometimes called "name
        service switching".  Under Solaris is configured in the file

Then I looked how we setup our /etc/nsswitch.conf:

# Begin /etc/nsswitch.conf

passwd: files
group: files
shadow: files

publickey: files

hosts: files dns
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: db files

# End /etc/nsswitch.conf

See how we have no reference for "nis" here? That's it, LFS-BOOK does not even 
enable nis resolution by default. That's why we don't need to setup NIS/YP 
domain name. I suggest then we add a paragraph with something like:

"If you are planning to use NIS, you should take a look at 
http://www.tldp.org/LDP/nag2/x-087-2-nis.html to see how to setup it 
properly. By default, we are disabling NIS name service support."

to http://www.linuxfromscratch.org/lfs/view/cvs/chapter06/glibc.html 
(Configuring Glibc).

> Its a simple addition to the bootscripts if needed anyway ;-)

No, it's not just that easy. You just found a gap on current LFS-BOOK network 
setup: we are disabling NIS name service by default, but not giving to the 
reader proper references to setup it if needed/desired.

man nsswitch.conf
Kdict :)

Anderson Lizardo
lizardo at linuxfromscratch.org

More information about the lfs-dev mailing list