/etc/inet/netmasks File
If your network runs NIS, NIS+, or LDAP, the servers for these name services maintain netmasks databases. For networks that use local files for name service, this information is maintained in the /etc/inet/netmasks file.
For compatibility with BSD-based operating systems, the file /etc/netmasks is a symbolic link to /etc/inet/netmasks.
The following example shows the /etc/inet/netmasks file for a class B network.
Example 5-3 /etc/inet/netmasks File for a Class B Network
If the file does not exist, create it. Use the following syntax:
network-number netmask-number |
Refer to the netmasks(4) man page for complete details.
When creating netmask numbers, type the network number that is assigned by the InterNIC (not the subnet number) and netmask number in /etc/inet/netmasks. Each subnet mask should be on a separate line.
For example:
128.78.0.0 255.255.248.0 |
You can also type symbolic names for network numbers in the /etc/inet/hosts file. You can then use these network names instead of the network numbers as parameters to commands.
Network Databases and nsswitch.conf File
The network databases are files that provide information that is needed to configure the network. The network databases follow:
hosts
ipnodes
netmasks
ethers
bootparams
protocols
services
networks
As part of the configuration process, you edit the hosts database and the netmasks database, if your network is subnetted. Two network databases, bootparams and ethers, are used to configure machines as network clients. The remaining databases are used by the operating system and seldom require editing.
Although nsswitch.conf file is not a network database, you need to configure this file along with the relevant network databases. nsswitch.conf specifies which name service to use for a particular machine: local files, NIS, NIS+, DNS, or LDAP.
How Name Services Affect Network Databases
The form of your network database depends on the type of name service you select for your network. For example, the hosts database contains, at minimum, the host name and IPv4 address of the local machine and any network interfaces that are directly connected to the local machine. However, the hosts database could contain other IPv4 addresses and host names, depending on the type of name service on your network.
The network databases are used as follows:
Networks that use local files for their name service rely on files in the /etc/inet and /etc directories.
Note - DNS boot and data files do not correspond directly to the network databases.
The following figure shows the forms of the hosts database that is used by these name services.
Figure 5-2 Forms of the hosts Database Used by Name Services
The following table lists the network databases and how they are used by local files, NIS+, and NIS.
Table 5-1 Network Databases and Corresponding Name Service Files
Network Database | Local Files | NIS+ Tables | NIS Maps |
---|---|---|---|
/etc/inet/hosts | hosts.org_dir | hosts.byaddr hosts.byname | |
ipnodes | /etc/inet/ipnodes | ipnodes.org_dir | ipnodes.byaddr ipnodes.byname |
/etc/inet/netmasks | netmasks.org_dir | netmasks.byaddr | |
/etc/ethers | ethers.org_dir | ethers.byname ethers.byaddr | |
/etc/bootparams | bootparams.org_dir | bootparams | |
/etc/inet/protocols | protocols.org_dir | protocols.byname protocols.bynumber | |
/etc/inet/services | services.org_dir | services.byname | |
/etc/inet/networks | networks.org_dir | networks.byaddr networks.byname |
This book discusses network databases as viewed by networks that use local files for name services. Information about the hosts database is in "hosts Database". Information about the ipnodes database is in "/etc/inet/ipnodes File". Information about the netmasks database is in "netmasks Database". Refer to System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP) and System Administration Guide: Naming and Directory Services (FNS and NIS+) for information on network databases correspondences in NIS, NIS+, DNS, and LDAP.
nsswitch.conf File -- Specifying Which Name Service to Use
The /etc/nsswitch.conf file defines the search order of the network databases. The Solaris installation program creates a default /etc/nsswitch.conf file for the local machine, based on the name service you indicate during the installation process. If you selected the "None" option, indicating local files for name service, the resulting nsswitch.conf file resembles the following example.
Example 5-4 nsswitch.conf for Networks Using Files for Name Service