SUMMARY: setup DNS client

From: Thang Victor Dinh (
Date: Tue Oct 01 1996 - 16:38:01 CDT

Thank you for an overwhelming response to my question ... way too many names for me to list them out here :)

Victor Dinh


What is the quickest way to set up a DNS client machine. This must be an easy question for you guys but I can't seem to remember.
I remember that under Solaris, you need to add/modify /etc/resolv.conf file but is this all ? How about under SunOS ??? Any help would be appreciated. Thank you


Solaris 2.X

1. create /etc/resolv.conf with the following format


2. edit the hosts line in /etc/nsswitch.conf to look as follow

        hosts: files dns

        comment: the above line tells the system to look at the /etc/hosts file first and then dns

Solaris 1.X

1. create /etc/resolv.conf with the following format


2. modify to use DNS.

SRDB ID: 4616

SYNOPSIS: On SunOS 4.1.X, how to use DNS without NIS (unsupported method)


On SunOS 4.1.X, how to use DNS without NIS (unsupported method)

When we try to ping or telnet by hostname, we always get an
unknown host error. /etc/resolv.conf is in place, and nslookup
works fine. How can we get DNS working?


This is the same solution as can be found in the Infodoc #3886:

     This is a procedure that can be used to add name resolver
     routines into shared libc library in SunOS_4.1.

NOTE: The Sun supported method of using DNS is via NIS, however
      we understand the need for customers to be able to run DNS
      without NIS which is why we provide the following procedure.
      Customers should be warned that they use this method "At
      their own risk," and Sun support will not be able to help
      them with DNS related problems if they choose this method.
     Load "SHLIB_CUSTOM" either from SunInstall or from

     Be sure to first have the file /etc/resolv.conf
     properly configured. This can be tested first with

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 that you just made, extract the pic .o from
   libc_pic.a and rm the file __.SYMDEF. The reason why you needed to do two
   "mv" commands is that "ar" truncated 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
        % ar x /usr/lib/libresolv.a

   The libresolv.a (apparently) contains object modules that are
   position-independent, so they can be added to the libc_pic modules
   without fear.

4. Remove the old routine to do the hostname/addr 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' and add the references
   to the resolver library routines by applying this patch:

                remove: gethostent.o

                   add: gethostnamadr.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 ****
                ! gethostent.o << REMOVE
                --- 150,161 ----
                ! gethostnamadr.o << ADD
                ! sethostent.o << ADD
                ! res_query.o << ADD
                ! res_mkquery.o << ADD
                ! res_send.o << ADD
                ! res_debug.o << ADD
                ! res_comp.o << ADD
                ! res_init.o << ADD

8. % make

9. You should have some built in the current directory. Test
   this library before installing by setting the environment
   LD_LIBRARY_PATH to the current directory, for example:

        % setenv LD_LIBRARY_PATH `pwd`
        % your_favorite_test_cmd (i.e. ping, ftp, telnet)

   Once you are satisfied that the new library works, install
   it with the following commands:

        % cp /usr/lib
        % ldconfig
        % unsetenv LD_LIBRARY_PATH

10. You are now running with the new library. Verify this by doing a trace
    command of "date":

        % trace date

    The output should state that the new library is being used.

PRODUCT AREA: Gen. Network
HARDWARE: Sun3, Sun4, Sun4c


Ric (<> "Ric Anderson", using RTD's public internet access)
Subject: 3.2) How do I use DNS instead of NIS for hostname resolution?

  The "normal" behavior of a hostname lookup under NIS is to consult the
  NIS hosts map and then DNS (if configured). You can change this so all
  hostname lookups go directly to DNS. The SunOS shared library mechanism
  allows you change the behavior of any command that is dynamically linked
  to the shared library. In SunOS 4.1 and greater releases, there is an
  optional package called "shlib custom" that contains a kit for
  rebuilding shared libraries. You can select this in suninstall or load
  it later. It will put the files in /usr/lib/shlib.etc. Note that
  machines that come with pre-installed SunOS don't include this. It
  contains both a "normal" and System V version of libc and some tools to
  build shared libraries. The Sun-supplied README file gives some help,
  but doesn't detail how to change the hostname lookup functions. The
  complete procedure for this is spelled out in "bindon41.shar", which is
  available for anonymous ftp from "" in "/pub" - it goes
  one step further and replaces the Sun resolver routines with BIND 4.8.3
  (or later) versions. Note that you can still use NIS for other things in
  environment, such as passwd, group info, etc - the NIS hosts map is just
  ignored. There are several important statically linked binaries that
  will break if you replace the Sun routines. "/etc/mount" is probably
  where you will first notice that it doesn't know about any host that is
  not present in /etc/hosts. The same goes for "rcp". My solution was to
  recompile mount and rcp with the new resolver routines, but you need
  source code to do this. Sun apparently will give you a dynamically-
  linked version of mount if you have software maintenance. You can
  compile your own version of rcp from the Berkeley 4.3 source that is
  available on various ftp site. Otherwise, you might just have to have
  all hosts (and aliases) in /etc/hosts that you want to mount or use
  Internet addresses (yuck). Another "feature" of a DNS-only environment
  is that hostnames will sometimes be returned all in uppercase and these
  will not match the lower-case entries you typically have in
  /etc/exports, /etc/bootparams, etc. There are some patches to BIND 4.8.3
  called "resolv+" that allow you to specify hostname lookups to
  /etc/hosts only, DNS only or both.

  bind 4.8.3 can be found on ( in
  /pub/BSD/UCB/bind.4.8.3.tar.Z. resolv+ is on (
  in pub/unix/sun/resolv+-2.1.tar.Z. A later version is available at
  The latest version of bind is available from (
  in /pub/misc/vixie.

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:11 CDT