Nsswitch: Name Resolution Service

Source: Internet
Author: User

Nsswitch: Name Resolution Service

App->nsswitch->resolve_lib

Libnss


/ETC/NSSWITCH.CONF Master configuration file

# Example:

#passwd: DB Files Nisplus NIS

#shadow: DB Files Nisplus NIS

#group: DB Files Nisplus NIS


Passwd:files

Shadow:files

Group:files


#hosts: DB Files Nisplus NIS DNS

Hosts:files DNS

# Example-obey only what Nisplus tells us ...

#services: Nisplus [Notfound=return] Files

#networks: Nisplus [Notfound=return] Files

#protocols: Nisplus [Notfound=return] Files

#rpc: Nisplus [Notfound=return] Files

#ethers: Nisplus [Notfound=return] Files

#netmasks: Nisplus [Notfound=return] Files

Nisplus return Value:

SUCCESS Service Ok,found name is healthy and goes to a value

NOTFOUND service Ok,name not found normal, name not converted to value

Unavaail Service not available services not found, when Unacaail will find files

Tryagain temporary service failure temporary failure, try again


Bootparams:nisplus [Notfound=return] Files


Ethers:files

Netmasks:files

Networks:files

Protocols:files

Rpc:files

Services:files


Netgroup:nisplus


Publickey:nisplus


Automount:files Nisplus

Aliases:files Nisplus


[Email protected] lib]# Vim/etc/protocols

[Email protected] ~]# vim/etc/services



Name Resolution Service:

Nsswitch call the corresponding library file in/usr/lib to parse

Getent get all entries for a library in Nsswitch

[Email protected] ~]# getent passwd

[Email protected] ~]# getent passwd Root

Root:x:0:0:root:/root:/bin/bash

[Email protected] ~]# Getent hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

127.0.0.1 localhost localhost.localdomain localhost6 localhost6.localdomain6

[[email protected] ~]# getent hosts www.baidu.com first go to the hosts if no more DNS to find

180.97.33.107 www.a.shifen.com www.baidu.com

180.97.33.108 www.a.shifen.com www.baidu.com






This article from "Operation and maintenance Growth Road" blog, declined reprint!

Nsswitch: Name Resolution Service

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.