6. Name services

There are 4 primary naming services within Solaris System V UNIX: DNS, NIS, NIS+, and files. Humans like names better than numbers, while computers like numbers. A naming service translates a word or phrase (i.e. mycomputer) to something the computer understands (i.e. 192.168.0.23). Look at the following to see an example:

Human preference What that means to computer
Joe 100 (UID)
Root 0 (UID)
/etc 137 (Inode)
/export/home 10935 (Inode)
localhost 127.0.0.1 (IP address)
mycomputer 192.168.0.23 (IP address)

To show hosts on a machine look in /etc/inet/hosts. This file holds information on other hosts on your network. Output may look like this:
127.0.0.1 localhost
192.168.0.24 myserver
192.168.0.23 mycomputer

To add hosts to this file, use the vi editor or type admintool (while logged in as root)

Comparison of NIS, NIS+ and DNS

NIS NIS+ DNS

Similarities

Naming service for any table

No relevant similarities

Works within organization, and is administered
The database is replicated, so if failure occurs, others database will pick up slack. Redundancy
Saves info on RAM

Differences

For small operations (for up to 1000 users) For large operations (1001+ users) Worldwide
The root on the server is the only administrator (admin) Special database for admins (admins for each table) Only for IP table
Only on flat domain Uses hierarchy of domains Outside of organization
Updates everything on database and updates are slow Updates only changes to database, and is fast Primary and secondary database
Unsecure Secure (uses validation) Saves information on hard drive
Simple Complicated
Any host recognizes Only Sun, HP can use NIS+ now

DNS (Domain Naming Service) is a global naming service. Characteristics of DNS

NIS and NIS+ (Network Information Services) is a way around DNS. Characteristics of NIS and NIS+:

Files is a local naming system. Characteristics of Files:

A. DNS

To have yourself as a DNS client edit /etc/resolv.conf. You will need the following info: (this is what the file will look like)
Domain mynetwork.com (this is where you put the name of your domain)
mycomputer 192.168.0.23 (This is where you put your nameserver information)

There is only one DNS domain for the world ( . or the nameless root) it is nameless and you put a space and dot.

There are two types of DNS

  1. Lookup (or Bind) – which goes to a caching server to look for the IP for you
  2. Database – which has primary and secondary servers that will just hold the top level domain information.

To create a lookup (bind), edit the /etc/resolv.conf (which controls how DNS works) file. It will hold the following info, and will look like the listing on the below:
domain [what domain you are in, i.e. mydomain.com]
nameserver [caching server the ISP will give you. You could have multiple nameserver entries]

After you edit the /etc/resolv.conf file, you will test DNS by using nslookup, then you go to a “>” prompt, and then type [the world wide web address] (i.e. http://home.earthlink.net/~pandsl). If it works then your DNS works.

To allow caching edit /etc/nsswitch.conf and puts the following entry: host: files dns

B. NIS+

To have yourself as a NIS+ client, use the following command: nisclient –i –h [nis plus server] –a [IP address] –d [nis plus domain]

C. NIS

To have yourself as a NIS client, use the following command: ypinit –c

Then for all three use the vi editor to modify /etc/nsswitch.conf (tells where records go to find info)

-or-

* order is very important. The not found will keep your system from freezing.

Client setup

  1. For NIS client you type ypinit –c (-c is for client)
  2. For NIS+ client type /usr/lib/nis/nisclient –l –h [masterserver.domain.com] –a [ ip of –h option] –d [domain.topleveldomain]. You must already have credentials on the master server which include “secure rpc password”, usually NIS+ to start, and you must also have the root password of the client.

Name Services

A common problem is to make sure that /etc/hosts is linked to /etc/inet/host, this will allow changes on 1 machine to go to many automatically. In /etc/nsswitch.conf – name service info will look like this:
Passwd: files

Service where to go for that info (could be nis, nis+ or dns or all)


  Go to Chapter 5       Go to Index        Go to Chapter 7