U.S. Geological Survey
U.S. GEOLOGICAL SURVEY BULLETIN 2103
Selected Papers in the Applied Computer Sciences 1994
APPENDIXES
CONTENTS
APPENDIX A.INSTALLING named 4.8.3 AND MODIFYING DNS SEARCH LISTS
OBTAINING named (VERSION 4.8.3)
If a UNIX-based computer is used as a secondary or cache-only name server with a dial-up connection to the primary name server, it should be running named (version 4.8.3 or later). named is just one part of the DNS software that runs on UNIX systems. The complete package is called Berkeley Internet Name Domain (BIND). Whenever one portion of BIND, such as named, is updated, the rest of BIND should be updated simultaneously. The following description of obtaining a new version of BIND and installing named on a UNIX workstation is summarized from Albitz and Liu (1992), Sun Internal Bug Report #1043729, and Mark Curtis (oral commun., 1993). These sources are highly recommended for anyone attempting to make these changes. This example has been tested only on a Sun workstation running SunOS 4.1.2. The most recent version of BIND can be obtained over the Internet by anonymous ftp to UUnet as follows (commands typed by the user are in bold):
% cd /tmp [change to a temporary storage area]
% ftp ftp.uu.net [connect to UUnet]
Connected to ftp.uu.net
220 ftp.UU.NET FTP server . . .
Name (ftp.uu.net.:user): ftp
331 Guest login ok, send e-mail address as password.
Password: [enter your e-mail address]
At this point, a long welcoming message is displayed.
ftp> cd networking/ip/dns/bind [change to the
correct directory]
ftp> binary [change to binary mode]
ftp> get 4.8.3.tar.Z [transfers BIND to local
system]
ftp> quit [finished with ftp]
At this point, BIND is in a compressed, archived format. To uncompress the file and unarchive the individual pieces, enter the following command:
% zcat 4.8.3.tar.Z | tar xvf -
There should now be several subdirectories under the temporary directory, including
bin, doc, include, man, master, named, res, and tools. If so, downloading the new
BIND has been successful.
INSTALLING named (VERSION 4.8.3)
There are several steps to installing a new version of BIND. A new resolver library must be built and installed, and named must be recompiled and installed. The resolver library is part of the operating system's shared "C" libraries. As a preliminary to building a new resolver library, the shared "C" library source code (part of the Shlib_Custom software category) must be included in the operating system installation. If it was not included in the original installation, it can be added by following the instructions in the Systems Administration Manual (see "add_services").
Building a Resolver Library
The first step in the installation process is to build a new resolver library from BIND 4.8.3. From the temporary directory, enter the following commands:
% cd res
% chmod +w Makefile
Edit Makefile:
add -I..include -DBSD=43 -pic -c
to the line that begins with CFLAGS=. Then:
% make
The resolver should compile without errors, several object files (with .o extensions)
should be created, and a library archive, libresolv.a, should be created. Then, run
ranlib on the new archive:
% ranlib libresolv.a
The new resolver library should now be complete. To test that the new resolver
modules will be usable, do the following test:
% ld -assert pure-text *.o
If ld issues no complaints, the object modules are probably safe to use.Itis important to use this version of libresolv.a for all subsequent compilations.
Updating the Shared Library
After a new resolver library version has been built, the next step is to incorporate the new resolver in the shared library, libc.so. This step is necessary because many network programs do not use named for name look-ups. Instead, they incorporate the name resolver directly by linking to the shared library. The following commands should create a new shared library including the new resolver:
% cd /usr/lib/shlib.etc
% mkdir tmp [create a new temp directory]
% cd tmp
% ar x ../libc_pic.a [extract object files from archive]
% rm __.SYMDEF [__ represents two underscores]
% mv rpc_dtablesize. rpc_dtablesize.o
% mv rpc_commondata. rpc_commondata.o
% mv xccs_multibyte. xccs_multibyte.o
[file name corrections required
by bug in archive program]
If the system is running NIS, continue with the commands given below; if the system is to run DNS without NIS, follow the steps given in appendix B for modifying the shared library before proceeding with the following steps.
% ar x /tmp/res/libresolv.a
[be sure this path points to the new
resolver library]
% rm __.SYMDEF [__ represents two underscores]
% rm mkstemp.o [duplicate module]
% ld -assert pure-text *.o
All object modules to be compiled in the new library should pass this test. If they do not, check that the appropriate CFLAGS have been used for the compilation and that ranlib has been run on the resolver library.
% cd ..
Compare the list of object modules in the file lorder-sparc with the object modules in the tmp subdirectory. If new modules exist in the directory that are not in lorder-sparc, they must be added to the end of the list. Then
% make libc.so
A new library, libc.so.x.y.z, will be created in the current directory. The version number, x.y.z, will be one greater than the last version created. This new library should be tested before it is installed on the system. Check for an existing LD_LIBRARY_PATH environmental variable:
% setenv
If LD_LIBRARY_PATH exists, save the contents so that it can be restored after the tests.
% setenv LD_LIBRARY_PATH `pwd`
This command sets the environmental variable, LD_LIBRARY_PATH, to point to the new library. Any network commands that use the shared library for name look-up (ping, ftp, telnet, and so on) can then be used to test the library. Once the functioning of the new library has been confirmed, it can be installed. The user must be logged in as root to install the library:
# cp libc.so.x.y.z /usr/lib
# ldconfig
# unsetenv LD_LIBRARY_PATH
If the environmental variable LD_LIBRARY_PATH had a previous value, restore it at this point.
COMPILING named
The next step in the process is to build a new version of named:
% cd ../named [change to new named directory]
% chmod +w Makefile
Edit Makefile:
add -I..include -DBSD=43 -pic -c
to the line that begins with CFLAGS=. Also, add
../res/libresolv.a to the line that begins with RES=. Then edit the
pathnames.h file to reflect correct pathnames for the system. In particular, for
SunOS 4.1.2 systems, the line
#define _PATH_XFER "/usr/libexec/named-xfer"
should be changed to
#define _PATH_XFER "/usr/etc/in.named-xfer"
Then
% make
Finally, if the compilation proceeds without errors, the new named and
named-xfer daemons must be installed into /usr/etc. The user must be
logged in as root to perform this installation.
# mv named /usr/etc/in.named
# mv named-xfer /usr/etc/in.named-xfer
The new named daemon installation is now complete.
Modifying DNS Search Lists
The reason for modifying the resolver and the shared library is to be able to control the resolver's search list. (The default search list was described in the section "DNS Name Look-Up.") If version 4.8.3 or later of the resolver is running, the search list can be changed by modifying the resolver configuration file, resolv.conf. This file is usually found in the /etc directory. To change the search list operation, add a search directive to the end of the configuration file. A search directive explicitly specifies the list of domains to be searched. The directive consists of the keyword, search, beginning in column one, followed by up to six domain names to be searched. The first domain listed in the search directive must be the system's default domain. If the default domain for the system is wr.usgs.gov, the following search directive would be equivalent to the default behavior without a search directive:
search wr.usgs.gov usgs.gov gov
To prevent the resolver from creating nonexistent host names by adding portions of the domain name to host names that are already complete, add a search directive to the name server's resolver configuration file, which contains only the system's default domain. For the example used above:
search wr.usgs.gov
This search directive, together with BIND 4.8.3, will allow a secondary name server to serve a local network without contacting the primary name server for every name look-up. Therefore, the local network having a secondary name server can maintain local operations even if the link to the primary name server is disabled.
APPENDIX B. DNS WITHOUT NIS ON SUNOS 4.X SYSTEMS
The version of DNS that is included with SunOS 4.x operating systems is
intended to run only with NIS or NIS+ installed. To run DNS without NIS, the shared
"C" library must be modified. To modify the library, the shared
"C" library source code (part of the Shlib_Custom software category)
must be included in the operating system installation. If it was not included in
the original installation, it can be added by following the instructions in the
Systems Administration Manual (see "add_services"). The information
included in this appendix is primarily a summary of Sun Internal Bug Report #1043729,
which is recommended for any user attempting to make these changes. The following
commands should create a new shared library that can run DNS without running NIS:
% cd /usr/lib/shlib.etc
% mkdir tmp [create a new temp directory]
% cd tmp
% ar x ../libc_pic.a [extract object files from archive]
% rm __.SYMDEF [__ represents two underscores]
% mv rpc_dtablesize. rpc_dtablesize.o
% mv rpc_commondata. rpc_commondata.o
% mv xccs_multibyte. xccs_multibyte.o
[file name corrections required by
bug in archive program]
% ar x /usr/lib/libresolv.a
This library is the original resolver library. If a newer resolver library is used, see appendix A for instructions for creating the new resolver before continuing.
% rm __.SYMDEF [__ represents two underscores]
% ld-assertpure-text*.o [test object modules]
% rm gethostent.o [remove old host name resolver]
% rm strcasecmp.o [remove redundant module]
% cd ..
Edit the lorder-sparc file to remove the reference togethostent and to add references to new resolver modules. Apply the following patch to change lorder-sparc:
% diff -rc2 lorder-sparc.orig lorder-sparc
*** lorder-sparc.orig
--- lorder-sparc
***************
*** 150,154 ****
getwd.o
getnetgrent.o
! gethostent.o
ypxdr.o
ttyname.o
--- 150,161 ----
getwd.o
getnetgrent.o
! gethostnamadr.o
! sethostent.o
! res_query.o
! res_mkquery.o
! res_send.o
! res_debug.o
! res_comp.o
! res_init.o
ypxdr.o
ttyname.o
For systems running SunOS 4.1.2, add the entry mblib.o to the end of the lorder-sparc file and make the following changes to Makefile:
Change the lines
libc.so:
ld -assert pure-text `${OBJSORT}
lorder-sparc tmp`
to
libc.so:
ld -assert pure-text `${OBJSORT}
lorder-sparc tmp` -ldl
Also, change the lines
libcs5.so:
ld -assert pure-text `${OBJSORT}
lorder-sparc tmp`
to
libcs5.so:
ld -assert pure-text `${OBJSORT}
lorder-sparc tmp` -ldl
Now make the new shared library
% make libc.so
A new library libc.so.x.y.z will be created in the current directory. The version number x.y.z will be one greater than the last version created. This new library should be tested before it is installed on the system. Check for an existing LD_LIBRARY_PATH environmental variable:
% setenv
If LD_LIBRARY_PATH exists, save the contents so that it can be restored after the tests.
% setenv LD_LIBRARY_PATH `pwd`
This command sets the environmental variable LD_LIBRARY_PATH to point to the new library. Any network commands that use the shared library for name look-up (ping, ftp, telnet, and so on) can then be used to test the library. Once the functioning of the new library has been confirmed, it can be installed. The user must be logged in as root to install the library:
# cp libc.so.x.y.z /usr/lib
# ldconfig
# unsetenv LD_LIBRARY_PATH
If the environmental variable LD_LIBRARY_PATH had a previous value, restore it at this point.
Return
to Chapter C
Return
to Bulletin 2103 Contents
Return to USGS Home Page
U.S. Geological Survey, ISD National Center, Reston, VA 22092, USA
URL https://pubs.usgs.gov/bulletin/b2016/chapa/ch_a.html
Contact: webmaster@pubs.usgs.gov
Last Modified: 9/8/95 (hem)