[ Printer Friendly Page ]
[ E-mail this Document to Someone ]
[ Was this document useful? Yes or No ]
Infodoc ID |
|
Synopsis |
|
Date |
3886 |
|
Using DNS without NIS (unsupported method) |
|
21 May 1996 |
This is a workaround to a situation of not wanting to run
under the recommended (and ONLY supported) method of accessing
DNS, as documented in Chapter 16 of the SunOS 4.1.X
"System and Network Administration" Manual.
Please note that, if you have any name resolution problems or
inconsistencies, you MUST to go back to the original library before
Sun can assist you. Please note that if you encounter any library
problems, that you will be "own your own", unless you restore the
libraries to the supported configuration.
As long as you understand the implications of applying this workaround,
however, you should have no problems.
Reasons for unsupportability include the following; these could also be
considered "gotchas" when running this modified library workaround -
i.e. "at your own risk":
1) Inconsistent behavior between statically and dynamically linked
executables (e.g. mount command that must run in single user mode and is
therefore statically linked with the oldgethostbyxxx() system calls).
2) Total dependency of system on route/connection to a valid nameserver as
listed in /etc/resolv.conf (no local /etc/hosts lookups at all).
3) Dependency upon an external nameserver for all new host to IP address
translation additions. This includes "localhost" (normally defined
as 127.0.0.1 in local NIS hosts map)
4) Varying degrees of incompatibility between gethostbyname() and
gethostbyaddr()
lookup results and ascii values used in files (e.g. /etc/exports,
/etc/host.equiv, .rhosts, etc.)
MAKING A LIBC.SO for DNS without NIS
******** NOT SUPPORTED BY SUN CUSTOMER SUPPORT **********
This is a procedure you can use to add name resolver routines
into your shared libc library in SunOS_4.1 through 4.1.3.
You must have fist loaded "SHLIB CUSTOM" either from suninstall
or from add_services.
Be sure to first have the file /etc/resolv.conf configured
properly. You can test this first with /usr/etc/nslookup. (nslookup(8))
Ref: SHLIB CUSTOM options in Languages Ref Manual
---------------------------------------------------------------------------
1. Become super user:
% su (if necessary)
2. Make a temporary directory:
% cd /usr/lib/shlib.etc
% mkdir tmp
3. Change to the "tmp" directory just made, extract the pic .o from
libc_pic.a and rm the file __.SYMDEF. The reason for the two
"mv" commands is because "ar" truncates filenames over 16
characters.
% cd tmp
% ar x ../libc_pic.a
% rm __.SYMDEF
% mv rpc_dtablesize. rpc_dtablesize.o
% mv rpc_commondata. rpc_commondata.o
% mv xccs.multibyte. xccs.multibyte.o
% ar x /usr/lib/libresolv.a
The libresolv.a (apparently) contains object modules position
independent, so they can be added to the libc_picmodules without
fear.
4. Remove the old routine to do the hostname and address resolution:
% rm gethostent.o
5. Remove the libresolv module that contains `strncasecmp' (which is now
in the main C library, so it is redundant):
% rm strcasecmp.o
6. % cd ..
7. Copy lorder-sparc to lorder-sparc.orig. Edit the file lorder-sparc
and remove the reference to `gethostent.o'. Ad d t he references to
the resolver library routines by applying this patch:
remove: gethostent.o
add: gethostnamadr.o
sethostent.o
res_query.o
res_mkquery.o
res_send.o
res_debug.o
res_comp.o
res_init.o
% diff -rc2 lorder-sparc.orig lorder-sparc
*** lorder-sparc.orig Thu Feb 8 05:27:46 1990
--- lorder-sparc Mon Apr 9 12:58:59 1990
***************
*** 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
8. % make libc.so
9. Some libc.so.x.y.z are built in the current directory. It is
recommended that this library be tested at this point, before
installing it. Do this by setting the environment LD_LIBRARY_PATH
to the current directory. For example:
% setenv LD_LIBRARY_PATH `pwd`
% your_favorite_test_cmd (ie. ping, ftp, telnet)
Once you are satisfied that the new library works, proceed to install it
with the following commands:
% cp libc.so.x.y.z /usr/lib
% ldconfig
% unsetenv LD_LIBRARY_PATH
10. Verify that the new library is running by doing a trace command
of "date".
% trace date
The output should report that the new library is being used.
Top
Sun Proprietary/Confidential: Internal Use Only
Feedback to SunSolve Team