Solaris ネーミングの設定と構成

nsswitch.conf ファイル

各ワークステーションの /etc ディレクトリには nsswitch.conf ファイルがあります。このファイルの各行は、ネットワーク情報の種類 (ホスト、パスワード、グループなど) と、それに対する 1 つ以上の情報源 (NIS+ テーブル、NIS マップ、DNS ホストテーブル、同一ワークステーション上の /etc など) を対応させています。nsswitch.conf ファイルの詳細は、Solaris ネーミングの管理 を参照してください。

/etc/nsswitch.conf ファイルは、Solaris 2.6 リリースをインストールすると自動的に作成されます。また次の 3 つの代替テンプレートファイルも作成されます。

これらの 3 つの代替テンプレートファイルには、それぞれネットワーク情報の情報源として NIS+、NIS またはローカルファイルを使用する、標準的なスイッチ構成が設定されています。DNS 用のテンプレートファイルは用意されていませんが、いずれの代替テンプレートファイルも DNS 用に編集して使用できます。詳細は、「DNS を使用できるようにする」を参照してください。Solaris 2.6 リリースをワークステーションに最初にインストールする際、インストーラはそのワークステーションのデフォルトのネームサービス (NIS+、NIS、またはローカルファイル) を選択します。インストールの途中、選択されたネームサービスに対応するテンプレートファイルが /etc/nsswitch.conf にコピーされます。たとえば、NIS+ を使う場合、インストーラは nsswitch.nisplusnsswitch.conf にコピーします。

インターネットに接続したネットワークの中で、DNS サービスを使ってインターネット上のホストにアクセスできる環境をユーザーに提供したいのであれば、「DNS を使用できるようにする」の説明に従って DNS 転送を可能にする必要があります。

通常の名前空間であれば (DNS の利用に関しては前述のとおり)、nsswitch.conf にコピーされたデフォルトのテンプレートファイルで十分に用が足りるはずです。

NIS+ 用デフォルトスイッチファイル

Solaris 2.6 リリースで提供される NIS+ 用スイッチファイルは、nsswitch.nisplus です。


例 1-1 デフォルトの nsswitch.nisplus ファイル

# 
# /etc/nsswitch.nisplus: 
# 
# An example file that could be copied over to /etc/nsswitch.conf; it 
# uses NIS+  (NIS Version 3) in conjunction with files. 
# 
# "hosts:" and "services:" in this file are used only if the 
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports. 
# the following two lines obviate the "+" entry in /etc/passwd and /etc/group. 
passwd: files nisplus 
group: files nisplus 
# consult /etc "files" only if nisplus is down.  
hosts: nisplus [NOTFOUND=return] files 
#Uncomment the following line, and comment out the above, to use both DNS
#and NIS+. You must also set up the /etc/resolv.conf file for DNS name 
#server lookup. See resolv.conf(4). 
#hosts: nisplus dns [NOTFOUND=return] files 
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 
bootparams: nisplus [NOTFOUND=return] files
publickey: nisplus 
netgroup:nisplus 
automount: files nisplus 
aliases: files nisplus 
sendmailvars: files nisplus

NIS 用デフォルトスイッチファイル

Solaris 2.6 リリースで提供される NIS 用スイッチファイルは、nsswitch.nis です。


例 1-2 デフォルトの nsswitch.nis ファイル

# 
# /etc/nsswitch.nis: 
# 
# An example file that could be copied over to /etc/nsswitch.conf; it
# 
# uses NIS (YP) in conjunction with files. 
# 
# "hosts:" and "services:" in this file are used only if the 
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports. 
# the following two lines obviate the "+" entry in /etc/passwd and /etc/group. 
passwd: files nis
group: files nis 
# consult /etc "files" only if nis is down.  
hosts: nis [NOTFOUND=return] files
networks: nis [NOTFOUND=return] files 
protocols: nis [NOTFOUND=return] files 
rpc: nis [NOTFOUND=return] files 
ethers: nis [NOTFOUND=return] files 
netmasks: nis [NOTFOUND=return] files	
bootparams: nis [NOTFOUND=return] files 
publickey: nis [NOTFOUND=return] files 
netgroup: nis 
automount: files nis 
aliases: files nis 
# for efficient getservbyname() avoid nis 
services: files nis
sendmailvars: files  

ファイル用デフォルトスイッチファイル

Solaris 2.6 リリースで提供されるローカルファイル用スイッチファイルは nsswitch.files です。


例 1-3 デフォルトの nsswitch.files ファイル

# 
# /etc/nsswitch.files: 
# 
# An example file that could be copied over to /etc/nsswitch.conf; it 
# does not use any naming service. 
# 
# "hosts:" and "services:" in this file are used only if the 
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports. 
passwd: files 
group: files 
hosts: files 
networks: files 
protocols: files 
rpc: files 
ethers: files 
netmasks: files	 
bootparams: files
publickey: files
# At present there isn't a 'files' backend for netgroup; the system will
# figure it out pretty quickly, and won't use netgroups at all. 
netgroup: files 
automount: files 
aliases: files 
services: files 
sendmailvars: files