HP Visualize J210XC IRIX to HP-UX Migration Guide - Page 63

Editing the /etc/hosts File, The Name Service Switch

Page 63 highlights

Configuring TCP/IP Editing the /etc/hosts File You can use any text editor to edit the /etc/hosts file. If you are not running BIND or NIS, you can use SAM. SAM also configures /etc/hosts when adding a new LAN card. To use SAM: 1. Start SAM # sam 2. Select Networking and Communications. 3. Select Internet Addresses. 4. Select Actions->Add . . . 5. Fill in the Remote System Name and Internet Address fields on the menu and select Apply. The Name Service Switch The Name Service Switch determines where your system looks for the information traditionally stored in the following files: /etc/hosts /etc/protocols /etc/services /etc/networks /etc/netgroup /etc/rpc For all types of information except host information, you can configure your system to use NIS (one of the NFS Services), the local /etc file, or both, in any order. For host information, you can configure your system to use Berkeley Internet Name Domain (BIND) (Berkeley's implementation of DNS), NIS, the /etc/hosts file, or any combination of the three, in any order. The default Name Service Switch configuration is adequate for most installations, so you probably do not have to change it. On HP-UX workstations properly setting the nsswitch.conf file can be critical to booting the system after it has been moved to a new subnet or if the DNS and.or NIS servers are unavailable for whatever reason. The simplest way to create a useful nsswitch.conf file is to copy the existing file /etc/nsswitch.conf_hp_defaults to /etc/nsswitch.conf. Edit the resulting file so that when the system does name resolution it first looks at the files entry followed by DNS and NIS. An example nsswitch.conf file from an existing system is: # # /etc/nsswitch.hp_defaults: # # An example file that could be copied over to /etc/nsswitch.conf; it # uses NIS (YP) in conjunction with files. # passwd: compat group: compat hosts: files [NOTFOUND=continue] dns [NOTFOUND=return] nis [NOTFOUND = return] networks: nis [NOTFOUND=return] files protocols: nis [NOTFOUND=return] files rpc: nis [NOTFOUND=return] files publickey: nis [NOTFOUND=return] files 58

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125

Configuring TCP/IP
58
Editing the /etc/hosts File
You can use any text editor to edit the
/etc/hosts
file. If you are not running BIND
or NIS, you can use
SAM. SAM also configures
/etc/hosts
when adding a new LAN card. To use SAM:
1.
Start SAM
# sam
2.
Select
Networking and Communications
.
3.
Select
Internet Addresses
.
4.
Select
Actions->Add . . .
5.
Fill in the
Remote System Name
and
Internet Address
fields on the menu and select
Apply
.
The Name Service Switch
The Name Service Switch determines where your system looks for the information traditionally stored in
the following files:
/etc/hosts
/etc/protocols
/etc/services
/etc/networks
/etc/netgroup
/etc/rpc
For all types of information except host information, you can configure your system to use NIS (one of the
NFS Services), the local
/etc
file, or both, in any order. For host information, you can configure your
system to use Berkeley Internet Name Domain (BIND) (Berkeley±s implementation of DNS), NIS, the
/etc/hosts
file, or any combination of the three, in any order. The default Name Service Switch
configuration is adequate for most installations, so you probably do not have to change it.
On HP-UX workstations properly setting the
nsswitch.conf
file can be critical to booting the system
after it has been moved to a new subnet or if the DNS and.or NIS servers are unavailable for whatever
reason. The simplest way to create a useful
nsswitch.conf
file is to copy the existing file
/etc/nsswitch.conf_hp_defaults
to
/etc/nsswitch.conf
.
Edit the resulting file so that when the system does
name resolution it first looks at the files entry followed by DNS and NIS. An example
nsswitch.conf
file
from an existing system is:
#
# /etc/nsswitch.hp_defaults:
#
# An example file that could be copied over to /etc/nsswitch.conf; it
# uses NIS (YP) in conjunction with files.
#
passwd:
compat
group:
compat
hosts:
files [NOTFOUND=continue] dns [NOTFOUND=return] nis
[NOTFOUND = return]
networks: nis [NOTFOUND=return] files
protocols:
nis [NOTFOUND=return] files
rpc:
nis [NOTFOUND=return] files
publickey: nis [NOTFOUND=return] files