:
:
:
: I have a Sun SPARCstation.
: NIS works on it but DNS does not.
: Any names which are in my /etc/hosts table are resolved properly, unfortunately
: any names not in the table cannot be found by my system.
:
: I'm tired of using IP addresses - please help me to get DNS working.
: When I use nslookup, the correct server is identified and an IP
: address is returned (non-authoritatively) for any host name I type.
:
: I do have the resolv.conf file set up to the correct server.
:
: A second problem I have is that I can ftp out of my system but I cannot
: ftp into my system from another host. I get a 'user access denied' after
: I (or anyone else) types in the correct login.
:
: Ftp used to work but not any more!
:
: Can anyone help.
: Much gratitude...
I was facing the same problem, when I came across this faq.
roland
Last Updated: 22th October 1992
------------------------------------------------------------------
DNS-no-NIS : How to get most SunOS commands to use DNS without NIS
------------------------------------------------------------------
This recipe is based on a version by Greg Earle, dated 25 Apr 90
Thanks to Steinar Haug for pointing out some bugs.
Background blurb:
-----------------
The Sun supported way of using DNS is through NIS. Please refer to the
System & Network Administration manual if you want to use NIS. This FAQ
offers no help in that respect.
However, many people want to use resolver-based lookups without having to
run NIS. A simple way to do this is by using a version of the libc.so
shared C library with the gethostbyname()/gethostbyaddr() routines replaced
by the equivalent functions from the BIND nameserver distribution's resolver
library.
For SunOS 4.0.x Sun created 'libc_resolv.so' versions. These were made
available via anonymous FTP. Try anonymous ftp to 'ftp.uu.net' and look
in directory '/systems/sun/sun-fixes'.
For SunOS 4.1.x you'll have to build custom shared libraries. To be able
to do this you need the Shlib Custom option installed. This software
will be installed in the '/usr/lib/shlib.etc' directory. You'll find a
README file containing instructions in this directory. You may want to
read it...
Fortunately, the /usr/lib/libresolv.a library has been compiled with
the '-pic' option, producing position-independant code. Thus you can
use this library when you create your DNS-version of 'libc.so'.
You may want to use an alternative implementation of the resolver
library there is one written by Bill Wisner (at present visiting
It's archived at a number of sites, use archie to find a host in
your area. The package is usually stored as `resolv+-2.0.tar.Z'.
There's a preliminary release of version 2.1 around as well.
You'll find more information about position-indipendant code and shared
libraries in the Programming Utilities and Libraries manual. You should,
however, be able to create the 'libc.so' library without reading manuals.
Note that you'll have to substitute a few file names if you're making a
system 5 libc.
Note that installing a new shared library will not alter the way
statically linked commands work. Try 'mount' and you'll see what
I mean. Don't ask me for a patch. Look in the Programming Utilities
and Libraries manual for a list of all the statically linked commands.
And, finally, no - I haven't tested this procedure using all combinations
of patches and SunOS 4.1.x versions. It should work on vanilla 4.1.1 and
4.1.2. The patch-minded person would maybe look at the following patches:
100170-09 : jumbo patch to fix various ld problems
100257-04 : jumbo patch for ld.so, ldd and ldconfig
100266-08 : libc replacement - Domestic Version (US) (4.1.1)
100267-08 : libc replacement - International Version (4.1.1)
100465-01 : patch for libresolv.a - DNS res_send() bug (4.1.1;?)
100531-02 : libc jumbo patch - Domestic Version (US) (4.1.2)
100532-02 : libc jumbo patch - International Version (4.1.2)
(Note - this is not a complete list, and I've only considered 4.1.1 and 4.1.2)
---------------------------------------------------------------------------
0. You must be root to do this.
1. Make a temporary directory if not present, and cd to it
% mkdir /usr/lib/shlib.etc/tmp
% cd /usr/lib/shlib.etc/tmp
2. Extract the pic .o from 'libc_pic.a' and '/usr/lib/libresolv.a'.
Remove the file __.SYMDEF.
You need to do the 3 'mv' commands bacause 'ar' truncates filenames
over 16 characters. (Note that the last 'mv' may not be documented in
your '/usr/lib/shlib.etc/README'. It's a patch.)
% ar x ../libc_pic.a
% ar x /usr/lib/libresolv.a
% rm __.SYMDEF
% mv rpc_dtablesize. rpc_dtablesize.o
% mv rpc_commondata. rpc_commondata.o
% mv xccs.multibyte. xccs.multibyte.o
3. Remove the old routine to do the hostname/addr resolution:
% rm gethostent.o
4. Remove the libresolv module that contains `strncasecmp' (which is now
in the main C library, so it is redundant):
% rm strcasecmp.o
5. You've finished the work in the 'tmp' directory...
% cd ..
6. The file 'lorder-sparc' in the '/usr/lib/shlib.etc' directory must
be edited to reflect the changes. Remove the reference to `gethostent.o'
and add the references to the resolver library routines by applying
this patch:
% diff -rc2 lorder-sparc.orig lorder-sparc
*** lorder-sparc.orig Thu Jul 30 12:38:58 1992
--- lorder-sparc Thu Jul 30 12:41:25 1992
***************
*** 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
7. You're SunOS may have this patched, but should check the 'Makefile' for
the following problem:
There should be a '-ldl' option in the 'ld' command lines.
8. Now you can make the new shared libary.
% make libc.so
9. Now you should have some libc.so.x.y.z built in the current directory.
It is recommended that you tested out this library at this point
before installing it. You can do so by setting the environment
LD_LIBRARY_PATH to the current directory for example:
% setenv LD_LIBRARY_PATH `pwd`
% your_favorite_test_cmd
Once you are satisfied that the new library worked, you can proceed
to install it with the following commands:
% cp libc.so.x.y.z /usr/lib
% unsetenv LD_LIBRARY_PATH
% cd ..
% ldconfig
10. You are now running with the new library. You can verify this by
doing a trace command of let's say "date".
% trace date
The output should inform you that the new library is being used.
-------------------------------------------------------------------------
Disclaimer: Neither I nor my employer will take any responsibility if
this recipe doesn't work.
--
----------------------------------------------------------------
Roland Yeo Computer Centre Operations Team
Nanyang Technological University Nanyang Avenue Singapore 2263